Gossamer Forum
Home : General : Perl Programming :

Converting a form into a hyperlink

Quote Reply
Converting a form into a hyperlink
I would like to know if there's a way in which I can convert a form into a hyperlink. The form is sent through the post method. I need this because I want a person to enter some data into a form, then, when they send the information, I would like to log that information onto a log, and finally, allow people to see what they asked.
To be concrete, say I want to add a search engine onto my page that redirects visitors to Altavista. Before visitors are redirected I would like to log the keyword they have searched for.

Is this possible?
What code should I use?
Thanks very much to everyone.
Quote Reply
Re: Converting a form into a hyperlink In reply to
 
Quote:
Is this possible?

Yes.

Quote:
What code should I use?

What, you want we should write it for you? I'm just kidding, but if you don't even know where to start, I think you would be better off reading a Perl book or playing around with a few more scripts first.

Which isn't very constructive for you I guess. Well, there's a tutorial that pretty much covers all the stuff you'll need for a script like this, at www.cgi101.com . It's not the be-all and end-all of tutorials, but I found it nice and simple, and still refer to it every now and then. The only thing you'll need that isn't covered there is how to redirect, which you would do with:

print "Location: $url\n\n";

So if you want to have a go, and you get stuck, post again and I'll try and help.

Cheers,
adam
Quote Reply
Re: Converting a form into a hyperlink In reply to
Actually, I have already written a pair of scripts. I really don't need a very basic tutorial. The thing is I don't know where to redirect the user. I mean, there are some scripts that get the input in the form script.cgi?name=james&address=5 but I already tried to pass it this way and it did not work. Any ideas of the exact syntax?

You know, I have the capability to write onto a file the info I desire, I could put a new submit button on my cgi, but I would like to avoid this step. I understand that as I'm sending information through the POST method the information does not travel through the URL. I haven't found clues in cgi101.

[This message has been edited by tachus (edited June 03, 1999).]