Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Passing values prob

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Passing values prob

Postby Alicia » 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&email=ab@yahoo.com>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.
Alicia
New php-forum User
New php-forum User
 
Posts: 94
Joined: Sun Sep 21, 2003 5:30 pm

Postby pootergeist » 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.
pootergeist
New php-forum User
New php-forum User
 
Posts: 191
Joined: Wed Jan 29, 2003 7:11 am
Location: UK


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.