Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Mar 2000
Posts: 143
Member
Member
Offline
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.

Sponsored Links
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.

Joined: Jul 2001
Posts: 108
Member
Member
Offline
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..

Joined: Oct 2000
Posts: 192
Member
Member
Offline
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");

wink

Joined: Mar 2000
Posts: 143
Member
Member
Offline
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?

Sponsored Links
Joined: Oct 2000
Posts: 192
Member
Member
Offline
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.

Joined: Mar 2001
Posts: 7,394
LK Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
Joined: Mar 2001
Posts: 7,394
Quote
quote:
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 ]

Joined: Oct 2000
Posts: 192
Member
Member
Offline
Joined: Oct 2000
Posts: 192
Yeah, yeah. tipsy

Joined: Mar 2000
Posts: 143
Member
Member
Offline
Joined: Mar 2000
Posts: 143
Thanks. smile I'll have to save that script so that once I know how to program, I can find out what it means! tipsy It'll happen. smile

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...

Sponsored Links
Joined: Nov 2000
Posts: 2,759
Pooh-Bah
Pooh-Bah
Offline
Joined: Nov 2000
Posts: 2,759
And if you're going to buy a book, start off with O'Reilly's Llama book.

-Tacks

Joined: Mar 2000
Posts: 143
Member
Member
Offline
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. smile

Joined: Sep 2000
Posts: 4,211
Master Hacker
Master Hacker
Joined: Sep 2000
Posts: 4,211
That book is [Linked Image]. wink


Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240430)