Include with a refresh

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
SirChick
Forum Contributor
Posts: 125
Joined: Tue Jul 31, 2007 11:55 am

Include with a refresh

Post 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?
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

Submit a form (or link, too) to a processing script, redirect back to the original page with header()
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
SirChick
Forum Contributor
Posts: 125
Joined: Tue Jul 31, 2007 11:55 am

Post 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?
User avatar
tecktalkcm0391
DevNet Resident
Posts: 1030
Joined: Fri May 26, 2006 9:25 am
Location: Florida

Post 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
Post Reply