...

View Full Version : using PHP to populate a spry panel



ajetrumpet
11-09-2010, 06:04 AM
all,

how, in general, can you run PHP/MYSQL queries without reloading a webpage? The first thing I learned about server side languages was that they execute first, no matter where the code is written. But if I wanted to put a collapsible spry widget on my webpage under a few dropdown boxes, and then wanted to expand that widget to list the contents of my database based on the dropdown criteria, how would I go about that?

I can get just about everything else done except the task of not reloading the page to execute the PHP query. What I essentially want is the collapsible panel to expand with the mysql data that is queried. Can someone give some insight on this please? thanks!

Keleth
11-09-2010, 06:08 AM
To get a page to change without reloading, you need client side technology, like Flash or Javascript. You cannot do it with PHP alone. For what you want, you'd need to build/find an AJAX module.

bngari
11-09-2010, 04:39 PM
use frames and/or ajax. php alone will not help.

ajetrumpet
11-09-2010, 07:30 PM
use frames and/or ajax. php alone will not help.

are you talking about the frame tag in HTML? I can go to w3schools and learn a little bit about them. Or are you talking about iFrames? What's the difference mind you?

Keleth
11-09-2010, 07:36 PM
Iframes allow you to basically open a new window in your current window... frames allow you to section off the website and run content in them.

In either case, I recommend against either. Frames are outdated and problematic. It makes bookmarking content, moving between content messy.

ajetrumpet
11-09-2010, 10:06 PM
Iframes allow you to basically open a new window in your current window... frames allow you to section off the website and run content in them.

In either case, I recommend against either. Frames are outdated and problematic. It makes bookmarking content, moving between content messy.

then I'm assuming all of the pages I see that dropdown panels like that and fill them with database content are using AJAX code, huh? Is that accurate?

Keleth
11-09-2010, 10:27 PM
then I'm assuming all of the pages I see that dropdown panels like that and fill them with database content are using AJAX code, huh? Is that accurate?

I doubt ALL, but a lot, sure. Most, probably. Any professionally well done site today? I'd bet.

MattF
11-09-2010, 10:44 PM
then I'm assuming all of the pages I see that dropdown panels like that and fill them with database content are using AJAX code, huh? Is that accurate?

Large percentage probably are. All the basic method consists of is either an empty container, paragraph, div or whatever type takes your fancy on the page, then get the content via AJAX and write the response text to the container via JS, or even create the container from scratch via JS too. As Keleth says, frames are a poor choice.

bngari
11-10-2010, 10:27 AM
it was a typo...iframes.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum