Page 1 of 1

Content Display

Posted: Mon Sep 05, 2005 6:13 am
by ScrewyWabbit
Hi All,

I have a problem Ive been trying to solve for a few days now, hopefully someone can help me out.

Here's my situation I have about 100 folders, each folder contains its own index.php page. Due to the fact a large number of folders are being used and folder content will be changed often I used php to display the dir to save constent hardcoding of links.

Now heres what I need to do:

When a disired folder is clicked I need the index page within the folder displayed in a DIV (yes it must be a div) Also the page must not refresh. The only way I saw to do it was using a hidden IFRAME and passing the vars to a DIV with JavaScript. I tryed a couple of the JS scripts floating around, The pages loaded into the DIV but all the php coding on the pages wasnt being recognized.

Any suggestions?

Posted: Mon Sep 05, 2005 6:57 am
by CoderGoblin
Sounds as though the XMLHttp Request/AJAX methodology may be of use. Have a look at this topic for a starting point or search on Google.

Posted: Mon Sep 05, 2005 7:10 am
by Fourtet
Iframes can't parse php - it can only send and receive data from it - you have to use a callback function which takes the data received from the iframe after it's called the php file, then attach it to a parent div. It's very simple after you do it for the first time, it sounds like you've already got your system in place though so it could be a bit of a pain in the backside to migrate to the iframe method. You could use xmlhttprequest which would make things a bit easier but still, you'd have to do some modfications to your server side code and you lose ie users without active x enabled. Whatever happens you'll have fun, rpc is challenging but very rewarding. :)

[Solved] Content Display

Posted: Tue Sep 06, 2005 6:41 pm
by ScrewyWabbit
Thanks for the suggestions, I think I have it licked now.