Hi, Please Help. Page 1. -------------------------- It has variables defined like var1 = 'name' var2 = 'email' It has a link to contact.html page. I want that hyperlink to set this way , so when user reachers contact.html the page is like this contact.html?var1=name&var2=email Hope you have understood and should be quick for someone knows php, i know it in asp, but dont know how to translate it into php and i am stuck. Please help. On Page two. =========== Just want to print this variables I did that through post method, but they are coming from get method, so i want something like querystring. Thanks alotttttttttttt in Advance.
I'm not actually sure about what you're trying to accomplish, But, if you're trying to get those values using a GET actions instead of POST it's simple : <?php $var1 = $_GET['var1']; // gets var1 from the url $var2 = $_GET['var2'];// gets var2 from the url echo "Var 1 :" . $var1 . "<br>Var 2 :" . $var2; ?> Code (markup): Please let me know if that solved your trouble, if not please be more specific I'll try to help you. Note 'echo' is a functions similar to 'print' but It's a little bit more faster at the execution time. Regards.
If page 1 has a form on it just set the target to include the get values you want: <form action='contact.php?var1=<?echo $name;?>&var2=<?echo $email;?>' method='POST'> HTML:
Yes my problem is solved. Thanks alot all of you. You might not have understood my requirement but your posts have given me my answer so thanks
Well, if he wants, I was using post in case the second form had long/sensitive values. It would work with both