Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing variables from form to php 1

Status
Not open for further replies.

mitja

Programmer
Jan 3, 2003
2
0
0
YU
I've got some questions about passing variables from form to php.
How can I just execute a php script without displaying it?
Can I execute one script and display another?
 
You made a from like this:

<FORM ACTION=&quot;post.php&quot; METHOD=&quot;POST&quot;>
<INPUT type=&quot;hidden&quot; name=&quot;user&quot; value=&quot;somebody&quot;>
<INPUT type=&quot;hidden&quot; name=&quot;redirect&quot; value=&quot;<INPUT type=&quot;text&quot; name=&quot;email&quot;>
<INPUT type=&quot;submit&quot; value=&quot;send&quot;>
</FORM>

By this form a user called somebody must type in his emailadres. This is send to the post.php script

You can also use METHOD=&quot;GET&quot; but you will see the passing variable then in your location bar of the browser.

At least you made the post.php site:
now you can use the variable names. They have the same name as the name of the INPUT areas.

<?php
echo($user); // Let you see: somebody
echo($email); // Let you see the value the user of the form gives.
// Now you can use some php who redirect to the page:
$redirect
?>

Hope this will help you,

Qwark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top