Gouki Posted December 9, 2005 Share Posted December 9, 2005 Hi guys.Basicly, I want the file to go to the very first line after it is "Done". If its not possible to go to the first line, calling a XPTO.php file would also work. This way I would call the same file (the one that is running) and the effect would be the same as going to the first line.Any help? I suck at programming!Let me know if I didn't explain myself too well. Link to comment Share on other sites More sharing options...
ILuvSnakMachines Posted December 9, 2005 Share Posted December 9, 2005 Not sure if this would work, I've been in java and not php recently (AP Comp Sci). But could this all go into a function in the php file, and then make a recursive call at the end? (recursive call means that the function will call it self again, thus the "reptition") Link to comment Share on other sites More sharing options...
Gouki Posted December 9, 2005 Author Share Posted December 9, 2005 Yeah. That should problably do the trick. Any ideas of how I can do it? Link to comment Share on other sites More sharing options...
spinFIRE Posted December 29, 2005 Share Posted December 29, 2005 (edited) I don't know Make a function called something and then call it at the end of the script againfunction hello() {//THE THING YOU WANT TO LOOP echo "<p>Hey how are you doing?!"; echo "<br />What is your name</p>";hello();}hello(); Edited December 29, 2005 by spinFIRE Link to comment Share on other sites More sharing options...
gamehead200 Posted December 29, 2005 Share Posted December 29, 2005 Why not just use a loop?for( $i = 0; $i < 100; $i++ ) {// Do what you want in here...}So $i is set to 0, and is incremented each time it runs until $i = 99, since it'll stop when $i can no longer be less than 100. Link to comment Share on other sites More sharing options...
Martijn Posted December 29, 2005 Share Posted December 29, 2005 or make a copy of the script and include it at the end like so:file.php-------file2.php| xxxxxxxxxxx || xxxxxxxxxxx |file2.php-----file.php Link to comment Share on other sites More sharing options...
Alanoll Posted December 29, 2005 Share Posted December 29, 2005 very last line do a require file.php;You may want SOME sort of conditional for that or it will endlessly keep including the php file Link to comment Share on other sites More sharing options...
Gouki Posted January 7, 2006 Author Share Posted January 7, 2006 very last line do a require file.php;You may want SOME sort of conditional for that or it will endlessly keep including the php fileWorked extremly well! Link to comment Share on other sites More sharing options...
quantumstate Posted January 29, 2006 Share Posted January 29, 2006 The other way to get the same effet would be to use a while loop and then use ob_flush() to output the stuff at the end continuosly.What do you want to use this for? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now