Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

refresh div with php script

Status
Not open for further replies.

ThomasJSmart

Programmer
Sep 16, 2002
634
Hello, i have a websituation wher i have to refresh a client side page when a change is made to the database. thing is i dont want the whole page to refresh as this would reset any textfield that have been filled in.
so it needs to be a div layer that gets refreshed.

one way would be to have the div layer refresh every x seconds and with every refresh the database gets queried and any new results are imidiatly shown to the client.

what i would like is that the client page only refreshes the div if a change has been made to the database...

i have managed to get a div refreshing every x seconds but it doesnt seem to be refreshing the php script, only the origional first-time content.. :(

any idea's people?

thanks,

I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
 
What you want is no small task, and PHP could be useful in it, but that's not where the hard part will lie. Further, what you're looking for is at this point only going to work in IE to my knowledge.

It's called a Remote Procedure Call... and there's a thread going on somewhere with a link to a decent article about how to use them in web design, but for the life of me I can' tfind it right now... you may want to ask in Web Site Designer's or Javascript (think Javascript is where it was).

-Rob

 
yea theres a big thing on it here:

sounds complicated, i'll try and do a timebased refresh then.

well i know how to refresh a div every x seconds now i need to get the javascript to also recognise and run the php script with each refresh...

working on it :) I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
 
well iv temporarily got it working with a set of frames and refresh tags :) i know... lazy :S awell i'll get round to it when i get time I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
 
Hey K9logic, you said
"well i know how to refresh a div every x seconds "

I'm a beginner in PHP and I don't want to lost some variables between 2 pages...
I want to refresh just a div.... how must I do
(or include a php page into this div)

please help
 
im not sure what you want to do but first of all refreshing a div will not refresh the php in that div.

to send php variables from page to page you can POST or GET them using a html form or you can save the variables into a session

if you want to just refresh the html content of a div layer then you can use a little javascript




I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top