Dynamic content / Overlays

Alles, was PHP betrifft, kann hier besprochen werden.

Dynamic content / Overlays

Postby graeme » 07. October 2005 16:23

Hello all

Here is a topic that I posted on Oracle. It thought to place it some other forums to see what comes back.
I'll post the original, then the few replies...

Graeme wrote:
Hi guys

First off I hope I'm using the correct terms... :)

Ok, I would like to create a web page where for example I have a message listing and an item listing. Only one is viewable at a time and the one should overlay the other, let's say in tabular format.
So if i click on the msg tab all the messages appear and visa versa.

The next thing is that all the msg and item data is sent in one request so the client browser should NOT have to return to the server when toggling between the 2 tabs.

Incl. is a simple script where I assign an 'echo' based on a form submission value.
So how i test is to fire up the browser with the given script, enter a few values and all is well. I then shut apache down and the html crashes with 'Page cannot be displayed'...
Basically I require the browser (once loaded) to operate on the given data set independantly ie. not returning to the server unless 'told' to.

Hope this is clear for you guys ;)

Thanks in advance

<title>Hello Oracle Forum</title>
<?php if ($_POST[x]=='a') {echo 'a';} else {echo '?';} ?>
<INPUT TYPE="text" NAME="x"/>
<INPUT TYPE="SUBMIT" NAME="submit" VALUE="submit a or ?"/>

... and in response:

PHP is a server parsed language, which means every function and command must be passed through apache to the php libraries on the server for processing. All the client browser gets on their end is the resulting HTML. In short, you can't do exactly what you're looking to do in PHP, because everytime you post or get, the browser is going to want to connect to the server. To accomplish this you'll likely want to use a client side language that can retain arrays and parse them. Java (and I believe action scripting in flash) can do this.

Alternatively, if you're simply looking to save database resources you can save the information in either a really long URL with get variables (this may get tricky with multi dimensional arrays), using sessions or cookies. You'll still need to pass the information back on up to apache, but with the data saved you wont need to hit the database everytime.

... so:
Basically I'm messed here :S I need a way of loading the session variables and toggling between two tables which are overlayed without returning to the server.
If this is achieved through scripting please be so kind to tell me / show me how.

Thanks in advance!

PS the original topic may be viewed at
http://forums.oracle.com/forums/thread. ... 1&#1078971
Posts: 2
Joined: 07. October 2005 15:47

Postby jakimo72 » 07. October 2005 17:40

You can also use an AJAX-Framework. There are some Frameworks that only uses Javascript. I would prefer an AJAX-Framework that can handle with both, clientsided and serversided scripting. At leased you need an serversided script to comunicate to your Database.
PHP is normally integrated in the Apache-Server. If you close Apache, you close PHP, too.
I tried the xajax-framework, it is a very small PHP library.
User avatar
Posts: 151
Joined: 07. February 2005 13:25
Location: Hamburg-Barmbek

Postby graeme » 10. October 2005 09:08

Thanks for that - I'll check it out ;)
Posts: 2
Joined: 07. October 2005 15:47

Return to PHP

Who is online

Users browsing this forum: No registered users and 2 guests