开发者

How do you use php?email=# to retrieve record

开发者 https://www.devze.com 2023-04-03 18:41 出处:网络
In abc.php, i have a form whose action is xyz.php. I want $email=$POST[\'txtEmail\'] to be used in xyz.php

In abc.php, i have a form whose action is xyz.php. I want $email=$POST['txtEmail'] to be used in xyz.php

To do that, I typed: <form id="form1" name="form1" method="post" action="xyz.php?<?php $email=$_POST['txtEmail']; ?>">

Is this the correct way to do it?

EDIT

abc.php

 <form id="form1" name="form1" method="post" action="xyz.php">
     <input name="txtEmail" type="text" size="30" />
     <input type="submit" name="Submit2" value="Submit" />
 </form>

xyz.php

<form id="form1" name="form1" method="post" action="def.php">
   <input type="text" name="txtAns" />                                                
   <i开发者_JS百科nput type="hidden" name="txtEmail" id="txtEmail" value="<?php echo $_POST['txtEmail']; ?>" />
  <input type="submit" name="submitEmail" value="Submit" />
</form>

def.php

$email=$_POST['txtEmail'];


Edited

In abc.php:

<form id="form1" name="form1" method="post" action="xyz.php">
  <input type="text" name="email" id="email" />
</form>

In xyz.php

<form id="form2" name="form2" method="post" action="def.php">
  <input type="hidden" name="email" id="email" value="<?php echo $_POST['email']; ?>" />
</form>

In def.php

$email = $_POST['email'];

Is that what you're after?

0

精彩评论

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