ari_aaron Posted March 31, 2006 Share Posted March 31, 2006 How can I make a page execute some code, and then go to another page? Quote Link to comment Share on other sites More sharing options...
High_-_Tek Posted March 31, 2006 Share Posted March 31, 2006 [code]<?php$var=1;$vat++;header("Location: index.php");?>[/code] Quote Link to comment Share on other sites More sharing options...
play_ Posted March 31, 2006 Share Posted March 31, 2006 Just to be on the safeside, ill add 2 lines of code to high - tek's post.[code]<?phpob_start();$var=1;$vat++;header("Location: index.php");ob_end_flush();?>[/code] Quote Link to comment Share on other sites More sharing options...
ari_aaron Posted March 31, 2006 Author Share Posted March 31, 2006 What does "ob_start();" do? Quote Link to comment Share on other sites More sharing options...
shortj75 Posted April 1, 2006 Share Posted April 1, 2006 your ob_flush(); will not execute once your code reaches header("Location: index.php"); the page will forward you to the index.php page so if you want the ob_flush() to work move it above the header code Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted April 1, 2006 Share Posted April 1, 2006 There is no reason for you to use ob_start(); for what high-tek has posted! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.