Cookies?

They have: 96 posts

Joined: Feb 1999

Hi Folks!

This is what I want to do:

I am looking a way to complete a form with name and e-mail and then use those Name and E-mail on another page, like when I click the send button in the form I am redirected to a page that says: Hello (Name) and the email (E-mail) of the information I completed in the form..

Do you have any idea how can I do that with a form? with cookies or what?

THanks a loooot!!

Nicolas Escobar J.
http://www.developy.com
Free resources for webmasters in spanish

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

simply send the info to the other page then print where desired...

page1

Name:
Name>

page2

#!/usr/bin/

#get the varibles that are incoming!
if ($ENV{"REQUEST_METHOD"} eq "GET") {
$input = $ENV{QUERY_STRING};
@pairs = split /\&/ , $input;

foreach $pair (@pairs) {
($name,$value) = split(/=/,$pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
$form{$name} = $value;
}
} else {
read(STDIN,$buffer,$ENV{'CONTENT_LENGTH'});
@pairs = split(/&/,$buffer);
foreach $pair (@pairs) {
($name,$value) = split(/=/,$pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
$form{$name} = $value;
}
}

print qq~

Hello $form{"Name"}!

~;

code is not tested. but should work... simply mimic the bold parts to add other fields.

Good Luck,

Mark Hensler
If there is no answer on Google, then there is no question.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.