I want navigate to other div on button click in specific page . How can i do it by header() function or any other function in 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
}
要重定向到其他页面,您必须使用header()
,语法如下:
header('Location: http://www.google.com/');
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.