#77779
10/22/2001 5:24 PM
|
Joined: Mar 2000
Posts: 143
Member
|
Member
Joined: Mar 2000
Posts: 143 |
Hi all. I'm just beginning to learn Perl/CGI. I haven't made any scripts yet, but I'd like my first to do this (could you please tell me if this is possible?):
I need to make a list of all travel agents so that a person could search for the agents in a particular zip code. What I'd like to do is develop a form where an administrator can enter in a name, address, company, etc. From here, a user could enter a zip code to pull up this information.
Now. Is it possible, once the first .cgi or .html is saved, to have the script APPEND that file with new information as it is received? Say several agents are in one zip code. I need to make something where each time a new agent is entered, this information is added to the rest..
Any advice would really be appreciated...
Thank you in advance
Sal Collaziano
P.S. If this is something easy to do and someone would like to make an offer to build it for me, that would be cool.
|
|
|
#77780
10/22/2001 6:18 PM
|
Joined: Sep 2000
Posts: 4,211
Master Hacker
|
Master Hacker
Joined: Sep 2000
Posts: 4,211 |
You could run something like a database, which is probably pretty complex to code. Or, as I understand it, you could do something pretty simple. It involves opening the file, adding your data, and then closing the file. The Perl gurus will have to back me up on this one, but that's the gist of it.
|
|
|
#77781
10/22/2001 6:31 PM
|
Joined: Jul 2001
Posts: 108
Member
|
Member
Joined: Jul 2001
Posts: 108 |
correct me if im wrong...
open(FILE, '>> file'); info to append here close(FILE);
again, correct me if im wrong..
|
|
|
#77782
10/22/2001 8:00 PM
|
Joined: Oct 2000
Posts: 192
Member
|
Member
Joined: Oct 2000
Posts: 192 |
open (FILE, ">>/home/file/file.txt") or die Cannot open damn file. print FILE "STUFF GOES HEREn!; close (FILE); chmod(0755, "/home/file/file.txt"); 
|
|
|
#77783
10/22/2001 9:45 PM
|
Joined: Mar 2000
Posts: 143
Member
|
Member
Joined: Mar 2000
Posts: 143 |
Is this the same way the UBB works?
It opens the .cgi file Adds to the .cgi file Then closes the .cgi file
That seems pretty simply. Am I understanding correctly?
|
|
|
#77784
10/22/2001 11:28 PM
|
Joined: Oct 2000
Posts: 192
Member
|
Member
Joined: Oct 2000
Posts: 192 |
I'm not sure if UBB uses that way, but that's the way I do it in my perl scripts.
|
|
|
#77785
10/25/2001 7:32 AM
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
It's not gonna work. open (FILE, ">>/home/file/file.txt") or die "Cannot open damn file."; flock(FILE, LOCK_EX); print FILE qq!STUFF GOES HEREn!; flock(FILE, LOCK_UN); close (FILE); chmod(0755, "/home/file/file.txt"); [ 10-25-2001: Message edited by: LK ]
|
|
|
#77786
10/25/2001 2:35 PM
|
Joined: Oct 2000
Posts: 192
Member
|
Member
Joined: Oct 2000
Posts: 192 |
Yeah, yeah. 
|
|
|
#77787
10/25/2001 3:46 PM
|
Joined: Mar 2000
Posts: 143
Member
|
Member
Joined: Mar 2000
Posts: 143 |
Thanks.  I'll have to save that script so that once I know how to program, I can find out what it means!  It'll happen. 
|
|
|
#77788
10/26/2001 6:03 AM
|
Joined: May 2000
Posts: 1,356
Addict
|
Addict
Joined: May 2000
Posts: 1,356 |
if you dont know Perl, you must get a Perl book...
|
|
|
#77789
10/26/2001 2:57 PM
|
Joined: Nov 2000
Posts: 2,759
Pooh-Bah
|
Pooh-Bah
Joined: Nov 2000
Posts: 2,759 |
And if you're going to buy a book, start off with O'Reilly's Llama book.
-Tacks
|
|
|
#77790
10/26/2001 2:58 PM
|
Joined: Mar 2000
Posts: 143
Member
|
Member
Joined: Mar 2000
Posts: 143 |
I just bought one. It's called, "Perl and CGI for the World Wide Web: Second Edition" by Elizabeth Castro.. Also, I bought some multimedia package which I'll get into as soon as I'm done with the book. 
|
|
|
#77791
10/26/2001 5:38 PM
|
Joined: Sep 2000
Posts: 4,211
Master Hacker
|
Master Hacker
Joined: Sep 2000
Posts: 4,211 |
That book is ![[Linked Image]](https://ubbdev.com/ubb/icons/icon13.gif) . 
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 69
Joined: January 2001
|
|
Forums63
Topics37,575
Posts293,931
Members13,824
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|