开发者

how to show value of one page to another page in php?

I have two pages like reg.php and profile.php. in reg.php have a field gender want to show on profile.php. i get gender field from r开发者_开发百科eg.php on profile.php.


A litle Sample to use a HTML Form for subimting data ....

reg.php

<form action="profile.php" method="post">
<input type="text" name="test" value="Test" />
<input type="submit" value="test" />
</form>

profile.php

<?php
echo $_POST["test"];
?>


Use one of the following:

  • Use a hidden form field and submit the form to profile.php.
  • Append the field to the URL like this: profile.php?gender=male.
  • Put the field in the user's session.
  • Put the field in a database, and retrieve it from the database in profile.php.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜