samedi 25 avril 2015

header redirect with include file


I've looked around on here and couldn't locate any solution for my little problem.

I currently have this following IF statment

if($page==1) {
    $sql = "UPDATE page SET page='1' WHERE id=1";
          INCLUDE 'month.php';
          header("Refresh: 10; url=http://XXXXX.co.uk/?p=2");           
    }

Which currently updates a database according to what page it is on and then includes the current month calendar file and I hoped I could redirect it to page number 2 which is very much similar but loads another calendar and the SQL adds +2 to the database.

In essence it's just a loop I've made and it just reads a SQL database to see what page it needs to load next< I know there's better ways to create a loop (just to scroll through 3 PHP pages) but I'm not that great at PHP..

So i'm just wondering really, could anybody help me to have that include statement along with the header refresh?

Like said the purpose is so that the pages rolls a loop, I've managed to get it all to work with an iframe (instead of the header) but it takes a few seconds longer for the frame window to load.


Aucun commentaire:

Enregistrer un commentaire