Page 1 of 1

Include with a refresh

Posted: Thu Aug 23, 2007 5:14 pm
by SirChick
Is there a way to do an include to run a script and then a refresh after the script is ran so that the code will run but the same page will load....

also can this be done using a href link instead of a form method?

I have a word link on messages.php :
Delete

and i want it to include the:
delete.php

then refresh the page back to the messages.php, with the new changes that the include had done..
is this possible? Or would the href link need to be on a form like submit buttons are etc?

Posted: Thu Aug 23, 2007 5:57 pm
by s.dot
Submit a form (or link, too) to a processing script, redirect back to the original page with header()

Posted: Thu Aug 23, 2007 6:00 pm
by SirChick
so can you not do this say was login page :

<a href="include.php"></a>


then at the bottom of the include put:

location login.php ?


so it kinda takes u back to same page?

Posted: Thu Aug 23, 2007 10:28 pm
by tecktalkcm0391

Code: Select all

<?php

if(isset($_GET['do']) && $_GET['do']==true){
    include("include.php");
    header("Location: http://site.com/page.php");
    exit();
}
Now to run the "include" script just make the URL when you want to run the code this:
http://site.com/page.php?do=true