我希望在特定页面中按下按钮导航到其他div。我如何通过header()函数或Php中的任何其他函数来实现?
<form action="" method="post">
<label for="name">Name:</label>
<input type="text" name="name" value="" />
<label for="email">Email:</label>
<input type="text" name="email" value="" />
<input type="submit" name="submit_request" class="submit_button" value="Sign up" />
</form>
<iframe name="my-iframe" src="about:blank"></iframe>
<div id="text_submit" class="text-success">
<p class="text-center">
THANK YOU FOR SIGNUP WITH US.
YOUR FORM SUBMITTED SUCCESSFULLY!
</p>
</div>
PHP
<?php
if(isset($_POST['submit_request']))
{
$name= $_POST["fn"];
$email= $_POST["ln"];
header("location:my-iframe") // this is a div
}
答案 0 :(得分:0)
要重定向到其他页面,您必须使用header()
这是语法:
header('Location: http://www.google.com/');