Passing values prob

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 94
Joined: Sun Sep 21, 2003 5:30 pm

Mon Sep 22, 2003 9:14 pm

in the first page, i pass the value of variables by using
<a href=enquiry.php?name=aa&>contact</a>

in enquiry.php file.. i capture the values by using $_GET["name"] and same goes to email. I guess it works.. i able to display these two values.

my prob:
i want to send these name and email i captured or displayed in my enquiry.php file to thanks.php after pressing the submit button..

how could i pass these two value then??? i tried to use $_POST["name"] to capture the value in thanks.php and then i also tried to use $_GET["name"]=$name in the enquiry.php but it still not working.. did i miss something or i did it in wrong way...

please advise.

New php-forum User
New php-forum User
Posts: 191
Joined: Wed Jan 29, 2003 7:11 am
Location: UK

Tue Sep 23, 2003 3:31 am

the easiest way (ie not sessions or cookies) would be to add the values to the form as hidden inputs

<form method="post" ....... >
foreach($_GET AS $var=>$val)
echo '<input name="' .$var. '" type="hidden" value="' .$val. '" />';

might need a urldecode depending on your settings.
avatar image based upon nasas apod (only updates if I post though)

Post Reply