开发者

Redirect PHP page

开发者 https://www.devze.com 2023-03-27 04:19 出处:网络
I want to redirect my page to save.php when i click save button and redirect my page to next.php when I click next button.

I want to redirect my page to save.php when i click save button and redirect my page to next.php when I click next button.

<form name="crtext" metho开发者_如何学JAVAd="post" action="o_crt_ext.php" enctype="multipart/form-data">

<input type="submit" name="save" value="save" />
<input type="submit" name="next" value="next" />
</form>

o_crt_ext.php

<?php
if(isset($_POST['save']));
{
header("location:save.php");
}
if(isset($_POST['next']));
{
header("location:next.php");
}
?>


remove the semicolons on the if statements

o_crt_ext.php

<?php
if(isset($_POST['save']))
{
  header("location:save.php");
}
if(isset($_POST['next']))
{
  header("location:next.php");
}
?>


Do you want to send any information if the user click on the Next-button? Of not: here you go.

 <form name="crtext" method="post" action="o_crt_ext.php" enctype="multipart/form-data">

 <input type="submit" name="save" value="save" />
 <input type="button" onclick="window.location.href='next.php'" value="next" />
 </form>
0

精彩评论

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