Javascript 传递单选按钮值时,PHP重定向到另一页上的锚链接

Javascript 传递单选按钮值时,PHP重定向到另一页上的锚链接,javascript,php,html,redirect,anchor,Javascript,Php,Html,Redirect,Anchor,我试图用php将表单值传递给另一个页面上的文本框。具体来说,我想在提交第1页上的表单按钮时链接到另一页上的文本框 第1页: echo '<td><input type="radio" name="myId" value= " ' . $myId . ' "></td>'; echo '<input name="mybutton" type="submit" value="Submit">'; 然后在第2页,锚定为: //if button

我试图用php将表单值传递给另一个页面上的文本框。具体来说,我想在提交第1页上的表单按钮时链接到另一页上的文本框

第1页:

 echo '<td><input type="radio" name="myId" value= " ' . $myId . ' "></td>';

 echo '<input name="mybutton" type="submit" value="Submit">';
然后在第2页,锚定为:

//if button clicked on Page1, redirect to here on Page2 and display the value in the textbox:

<a name="link">
<input type="textbox" value="<?php echo $myId;?>">
myId被传递,但重定向到锚的操作不起作用

在第1页,我还尝试检查mybutton和myId是否已设置:

if (isset($_POST['myId']) && ($_POST['mybutton')) 
但这没什么区别

将myId传递到Page2没有什么问题,但是在我添加标题位置重定向时,这会停止传递数据吗

感谢您的帮助。

更改为:

header('Location: http://localhost/dirc/mypage.php?myId='.$_POST['myId']);
如果您想访问它,请使用

<input type="textbox" value="<?php echo $_GET['myId'];?>">

在代码中定义$myId的位置是什么?myId是从Mysql查询中提取的:$myId=$row['myId'];谢谢你的帮助。这会将数据发布到ok,但重定向到文本框不适用于您的更改,数据已成功传递到文本框,但重定向仍然不起作用。下面是查询字符串中传递的内容的示例:29563。删减空白没有什么区别。你对瑞文尼根很有帮助。非常感谢你。
header('Location: http://localhost/dirc/mypage.php?myId='.$_POST['myId']);
<input type="textbox" value="<?php echo $_GET['myId'];?>">
 header('Location: http://localhost/dirc/mypage.php?myId='.$_POST['myId'].'#'.$_POST['myId']);