Thursday, 15 July 2010

PHP Page Refresh not working inside loop -



PHP Page Refresh not working inside loop -

i want page refreshed if particular form submitted after performing few tasks. page works not refreshes, don't know problem is.

here code :

update : using php action self affection process

<form action="<?php echo $_server['php_self'];?>" method="post"> // form values here </form> <?php if(isset($_post['sub'])) { //few operations $result=mysqli_query($con,$sql); if($result) { header("location: http://www.google.com"); } else { //no operation } } ?>

what error doing , how can solve ?

you can't set new location after have done output form above, because headers document have been generated. headers can sent 1 time , should @ top of php script, if want check something.

php

No comments:

Post a Comment