print('<meta http-equiv="refresh" content="1;url=index.php">');
print("<br/>Redirecting in 1 seconds...");
Hey guys, how do you refresh the curent page?
If I say I am in eh, items.php and I do a refresh, how could I go back to items.php and not index.php? I know the URL above is just hyperlink, but how is it possible to link back to the present page?
Leave out the URL value in the content attribute.
http://en.wikipedia.org/wiki/Meta_refresh
OR
Use PHP to send a HTTP header that instructs the browser to refresh the page. Works similarly to the meta refresh method. Do note that the header() must be called before any output is sent to the browser (i.e. before any echo(), print() whatever).
http://www.desilva.biz/php/phprefresh.html
I gt the same resources but it didn't answer the question.
because I have gt a function which is included in every page, every choice i POST, it will redirect to the homepage which is index.php. Instead if I add my function like say in items.php, I execute, how is it going to refresh from items.php to items.php and not items.php to index.php. Similarly if you hit F5
There's something wrong with your POST-handling function then. Because the two methods above worked for me perfectly.
Using a meta tag:
http://latecomerx.com/work/Project_170_Refresh/file2.php
Using PHP's header():
http://latecomerx.com/work/Project_170_Refresh/file3.php
Look at the function and see if any statement is causing it to redirect to "index.php". There's probably a header('Location: index.php'); somewhere.