Reloading A Php File Everytime A Click Is Made?

Started on the old forum in May 2008 · view the original in the archive · old links redirect here

5 replies · 483 views · started 18 years ago · 1 min read

3 participants
jozman Newbie · 2 posts #1

How can I do the above, in my script everytime a I post a new topic or reply It doesnt appear untill the user personally RELOADS the page, How can I make it auto display my post or forum topic? Please help External image (may be gone)

K3V Junior · 20 posts #2

How can I do the above, in my script everytime a I post a new topic or reply It doesnt appear untill the user personally RELOADS the page, How can I make it auto display my post or forum topic? Please help External image (may be gone)

You can refresh usin' metatags eg ...

<META HTTP-EQUIV="refresh" content="0;URL=http://www.blablabla.com/index.html" >

Place that in your head tags

crazybrumi Super moderator Principal · 1,064 posts #3
<head> <META HTTP-EQUIV="Refresh" Content="10"> </head>

10 being the number of seconds after refreshing, theres no need for a url at the ent but yu can av it but i dont see the point as itl do the same job

Want something coded email me at sales@webnwaphost.com for a prices.

http://flagcounter.com/more/W80q

jozman Newbie · 2 posts #4

thanx 4 replying, but i ddnt help much... the first method made my script to reload every nano second... so ive now resoted to using HEADER('Location: MYURL'); after all my sql queries, and it does the work so far, will now just have to come out a way to thank my visitors for posting:)

Guest #6

This depending on what browsers are being used.

The simplest one, that is almost certain to work on most browsers, is a standard refresh. It is suggested above that you use META-REFRESH in the headers section of your code.

<META HTTP-EQUIV="Refresh" Content="5">

For it to refresh the page automatically when a new post is found or on every mouse click, you would need to use Javascript (possibly AJAX, but this may not be necessary) to check the time/date of the last message in that topic / group / category / whatever and if it differs from what you have on screen, then it tells the browser to reload the page. This is just one way to check for new posts, there are others. These checks could be done every second or every half hour - whatever you find suits best but every 30 seconds sounds reasonable to me.

If frames are available for use (not all browsers allow you to use frames - most mobile phones do not support them, though I'm unsure about newer models), then you could do exactly the same, but with a tiny frame (1x1px) reloading every 30 seconds. If it finds a new post, it could then refresh the page.

I do not know if anybody here uses Gmail, but if you are viewing a 'conversation' and a new message arrives, then a little message in the corner of the screen alerts you to it and you have the option of renewing the page. To me, this is a little more user-friendly, but it depends entirely upon which browser you are using and what functionality they have enabled.

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close