Jump to content

Recommended Posts

Posted

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.


Posted

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")

  • 3 weeks later...
Posted (edited)

I don't know :whistle:

Make a function called something and then call it at the end of the script again

function hello() {

//THE THING YOU WANT TO LOOP
echo "<p>Hey how are you doing?!";
echo "<br />What is your name</p>";
hello();
}

hello();

Edited by spinFIRE
Posted

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.

  • 2 weeks later...
Posted
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

Worked extremly well! :thumbup

  • 4 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...