Jump to content

[SOLVED] redirect page at the end


thyscorpion

Recommended Posts

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....

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.