Log in

View Full Version : sending form data to another page



hemi519
01-03-2011, 06:22 PM
Hi All,

I want to know how to send the form data into another page without using any appending id like nextpage.php?id=1&name=name&..............

Suppose i am having my registration page where iam filling all the user data. when i press submit it should not submit those values in database in this page it should directly goto another page and should save the values in database in that page. Is it possible?

mchale
01-03-2011, 08:31 PM
There are a few ways of doing this.

You can use method post instead of get, it still sends it through the header but not the url. You can also set a cookie or a server variable to keep a state, though generally you would want to use method='get' or method='post' to do this.

Hope this helped.

VijayKanta
01-04-2011, 06:11 AM
mchale is spot on.



<form name="myform" method="post" action="script.php">

</form>


PHP code

<?php
extract($_POST);
?>


When you run that function all your form input elements` names will be turned into variables. For example you used name "username" for <input> tag it will converted to $username for you to work around with it in your script page.