how to display php results in a div

A

Asra

Hello,
I have a web page with lots of divs. In one of them, there is a form
which calls for a php document. The problem is that the php results
have to be shown only in that div. Currently, the whole page is
replaced by the php document. Any help would be greatly appreciated.
-Asra
 
T

Thomas 'PointedEars' Lahn

Asra said:
I have a web page with lots of divs. In one of them, there is a form
which calls for a php document. The problem is that the php results
have to be shown only in that div. Currently, the whole page is
replaced by the php document. Any help would be greatly appreciated.

Solutions:

A) Retrieve the results with XMLHttpRequest and add element nodes to
the document. Will AFAIK currently only work with Mozilla/5.0,
IE/Win with enabled (and not too much restricted) ActiveX support
and Safari/MacOS X, and will of course only work with enabled
client-side script support.

B) Use "iframe" or "object" elements to refer to a document with the form.
Submitting the form will then only replace the container's location/
document. "iframe" elements will not work with NN4, "object" elements
embedding (X)HTML documents will probably not work with IE.

C) Have the PHP script generate the whole document, including the results
if certain request variables are set.

Solution C would be best because most reliable.


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top