Kay1021 Posted June 25, 2009 Share Posted June 25, 2009 Is there a way that i refresh a page depending on circumstance. like if($refresh=='yes'){ //refresh page } thanks Quote Link to comment https://forums.phpfreaks.com/topic/163708-refresh-page/ Share on other sites More sharing options...
ldougherty Posted June 25, 2009 Share Posted June 25, 2009 Sure, just use some type of page refresh be it HTML, Javascript, etc.. http://www.htmlgoodies.com/tutorials/getting_started/article.php/3479551 Quote Link to comment https://forums.phpfreaks.com/topic/163708-refresh-page/#findComment-863807 Share on other sites More sharing options...
Kay1021 Posted June 25, 2009 Author Share Posted June 25, 2009 I've been searching and everything i found was about a user clicking....or doing it after a certain period of time. like the meta tag has to go in the head tags so that doesn't help...i was hoping there was another way Quote Link to comment https://forums.phpfreaks.com/topic/163708-refresh-page/#findComment-863810 Share on other sites More sharing options...
ldougherty Posted June 25, 2009 Share Posted June 25, 2009 You can just use the header function to send a new url to the browser, ofcourse you have to specify the url as the current page but that would work for you. http://us3.php.net/manual/en/function.header.php Quote Link to comment https://forums.phpfreaks.com/topic/163708-refresh-page/#findComment-863813 Share on other sites More sharing options...
Kay1021 Posted June 26, 2009 Author Share Posted June 26, 2009 Thanks that's what i thought i had to use...the header but it wasn't working I guess i just have to try a different approach. It's because i'm using like a lightbox thing...and i wanted the page to refresh after you closed the lightbox...i was using some script i had used other times...that would send a variable through the url in the js and then (in the other cases) i would GET and then update my database....i thought i could do the same thing just GET and then do the refresh if the terms were right. But it doesn't seem to be doing anything....i'll have to try something else thanks for the help Quote Link to comment https://forums.phpfreaks.com/topic/163708-refresh-page/#findComment-863823 Share on other sites More sharing options...
Kay1021 Posted June 26, 2009 Author Share Posted June 26, 2009 ok my code does work...just not the refresh...i tested it updating my db and it does so when you close the box....however you have to manually refresh the page to see the results if i put the header code in there it doesn't do anything this is my code on the php page (view_category) if(isset($_GET['r'])) { //updating database works here //header("Location: view_category.php"); will not do anything } I can't find anything to work...i just want it to refresh Quote Link to comment https://forums.phpfreaks.com/topic/163708-refresh-page/#findComment-863844 Share on other sites More sharing options...
.josh Posted June 26, 2009 Share Posted June 26, 2009 maybe it doesn't work because you have it commented out? Quote Link to comment https://forums.phpfreaks.com/topic/163708-refresh-page/#findComment-863856 Share on other sites More sharing options...
Kay1021 Posted June 26, 2009 Author Share Posted June 26, 2009 i don't have it commented out in my code...i was just making a note Quote Link to comment https://forums.phpfreaks.com/topic/163708-refresh-page/#findComment-863862 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.