How to refresh page without click refresh button?
Moderator: General Moderators
How to refresh page without click refresh button?
i need some help in php coding...
the problem i desire to solve is after i purchase and add cart...
the cart contain in main page will need refresh once..
how can i do it without using refresh button ?
thanks
the problem i desire to solve is after i purchase and add cart...
the cart contain in main page will need refresh once..
how can i do it without using refresh button ?
thanks
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
there'sthere are others, but those are the basics..
Code: Select all
<meta http-equiv=refresh content="5; url=http://blah.com">
and
<script language="javascript">document.location.href = "http://blah.com";</script>I'd like to thanks for comment feyd!
but i'm not very understand the statement ... :p
can u brief explain to me
<meta http-equiv=refresh content="5; url=http://blah.com">
and
<script language="javascript">document.location.href = "http://blah.com";</script>
but i'm not very understand the statement ... :p
can u brief explain to me
<meta http-equiv=refresh content="5; url=http://blah.com">
and
<script language="javascript">document.location.href = "http://blah.com";</script>
in php;
Code: Select all
header('Refresh: 7200'); // refresh every 2 hours- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
<meta http-equiv=refresh content="5; url=http://blah.com">
normally goes in a page's header.. like thisthe 'content' attribute contains 1 or more things. A timeout in seconds (in this case, 5 seconds), and an optional url value of where to redirect to. if the optional url is desired, a semicolon and 'url=' should appear after the timeout value. If the optional url is left out, the page will refresh itself at the specified time.
<script language="javascript">document.location.href = "http://blah.com";</script>
this can be placed pretty much anywhere in the html, however, the page will redirect to the specified address immediately when it's hit. If you wish to delay the time, like how the meta refresh works:this will also get called in 5 seconds, note that the time, is in milliseconds, not seconds.
normally goes in a page's header.. like this
Code: Select all
<html>
<head>
<!-- meta tags go in here -->
</head>
<body>
content appears here
</body>
</html><script language="javascript">document.location.href = "http://blah.com";</script>
this can be placed pretty much anywhere in the html, however, the page will redirect to the specified address immediately when it's hit. If you wish to delay the time, like how the meta refresh works:
Code: Select all
<script language="javascript">setTimeout('document.location.href = "http://blah.com";',5000);</script>- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
in the popup, use or similar
edit: oops.. that should be onunload.
Code: Select all
onunload="window.opener.location.href = window.opener.location.href"edit: oops.. that should be onunload.
Last edited by feyd on Tue May 25, 2004 12:50 pm, edited 1 time in total.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
more like
your main page, the page that created the popup, will get refreshed, or at least should.. you may need to fake it out a little bit.. as some browsers may not really refresh, since it's telling it to load the same page..
Code: Select all
<body onunload="window.opener.location.href = window.opener.location.href">