thyscorpion Posted July 1, 2007 Share Posted July 1, 2007 Hi, I looked and looked for half a day and have not found a solution for my problem, hence i am posting it here. I want to reload my php page once. I can't use header func as i need to run a lot of code and html tags before i require the reload. (say in the middle of the php page.) so its safe to assume i have given a load of chars to the browser before i want to reload/redirect to the same page. :-) Can anyone suggest any ideas on how to go about doing this automatically? Thanks a Ton.... Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted July 1, 2007 Share Posted July 1, 2007 You can have JavaScript do it. Put this code wherever you are wanting to redirect in your script: <script language="javascript"> window.location.reload() </script> Note: You are either going to have to echo these lines out, or do it out of the PHP tags. Quote Link to comment Share on other sites More sharing options...
thyscorpion Posted July 1, 2007 Author Share Posted July 1, 2007 You can have JavaScript do it. Put this code wherever you are wanting to redirect in your script: <script language="javascript"> window.location.reload() </script> Note: You are either going to have to echo these lines out, or do it out of the PHP tags. Hey thanks.. One Question though.. Can i also instead of reloading the file. just direct to the page? (i am using POSTDATA on the same file.) so a simple loading of the php file instead of the reload/refresh option will work better. as when i use ur above code.. it warns me of POSTDATA being sent again. :-) sorry to trouble you again. my mistake. i should have been more clear. Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted July 1, 2007 Share Posted July 1, 2007 Just change that code to this <script language="javascript"> window.location = "www.url.com" </script> Quote Link to comment Share on other sites More sharing options...
thyscorpion Posted July 1, 2007 Author Share Posted July 1, 2007 Thanks :-) i am fool i didn't read up on javascripts! :-) cheerio Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted July 1, 2007 Share Posted July 1, 2007 No problem =] Don't forget to mark the topic as "solved". Quote Link to comment 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.