i have a feedback.php page with javascript validation..so no one can submit any empty feedback..but after send a feedback if i click on refresh button on browser menu it is submitted again..
i can avoid this by submitted the feedback and take the control to the different page with a flash message that ur feed back submitted successfully..
but question is that i want to stay same feedback.php page after submitted the feed back..and the refresh button will not send the feed back again and again
thanks in advance
redirect page with header function
Moderator: General Moderators
Re: redirect page with header function
it can be done by two ways :
1. using header function (php)
2. using window.location (java script)
1st one is
2nd one is using javascript
1. using header function (php)
2. using window.location (java script)
1st one is
Code: Select all
<? . . . . . .
your code
. . . . . .
if(condition is true)
header("Location: feedback.php");
?>
Code: Select all
<? . . . . . .
your code
. . . . . .
if(condition is true){
?>
<script type="text/javascript">
window.location="feedback.php";
</script>
<? }?>
Re: redirect page with header function
dheeraj wrote:it can be done by two ways :
1. using header function (php)
2. using window.location (java script)
1st one is2nd one is using javascriptCode: Select all
<? . . . . . . your code . . . . . . if(condition is true) header("Location: feedback.php"); ?>Code: Select all
<? . . . . . . your code . . . . . . if(condition is true){ ?> <script type="text/javascript"> window.location="feedback.php"; </script> <? }?>