Forum Home
Press F1
 
Thread ID: 36774 2003-08-20 01:07:00 Web Designers (PHP) is this possible? Kame (312) Press F1
Post ID Timestamp Content User
168843 2003-08-20 01:07:00 A site with links but it's all controlled from one page?

e.g. If I have a link to products, I click on that link and instead of loading up a new products page, it'll find within the PHP script the line to write up the products page within the same document without leaving the index.php.

Basically the index.php is a template (dumping ground) that holds the entire code for the site, every link is linked to the code within the PHP document to write in the new output for the page.

Is this possible, any clues on how to accomplish this, I have a fair idea of what I'm trying to do, although I'm not sure if it can be done without reloading the entire page over and over again.
Kame (312)
168844 2003-08-20 01:17:00 I may be off course here, but why not do it in frames. So that the result of the hyperlink will display in a frame. Obelix (752)
168845 2003-08-20 01:26:00 I'm just wondering if it can be done without frames. It's kind of the same thing really apart from having seperate pages to load into different sections.

I'm just trying to eliminate all the pages, so I only need to work on one page that has all the code in it, that way I don't need to open up individual pages to work on it.

Unless there's a way to work on multiple pages. I know of injecting small codes that can alter the whole site layout but it still requires writing up those pages and having them readily available so that the transition can take place.

I want to create a site all in one page.

There's probably no logic in it other than I can just work on one page instead of multiple pages.
Kame (312)
168846 2003-08-20 01:38:00 You'd click a link for harddrives and it might be to products.php?cat=3 which will then fetch the right information from a mySQL database and serve up that page.

I know it's all possible, I just don't know how to do it myself ;)
-=JM=- (16)
168847 2003-08-20 01:42:00 If you want everything in one page it's going to have a very long load time. But it can be done easily in html using anchors. Or you could have a new window open up using javascript or html with the blank tag Greg S (201)
168848 2003-08-20 01:45:00 well considering the server I've got hosting the site is useless when you ask them for these things I have still not received a mysql database so I'm also eliminating the need for that.

I think I've got an answer for it. Just means writing the entire page in PHP and no stepping out of it which is alright, will take me a while to do it so I guess I've kept myself busy, I don't know what problems I may face doing it this way but I think to be safe, I'll create multipages as a backup in case it doesn't work to plan.
Kame (312)
168849 2003-08-20 02:20:00 I don't know how load time will be affected until I can get it working, I'm assuming it should affect the viewer as the page will only load what they requested and not more than that. It will however hold the entire code of the site, so basically I'll test it when I've got two sites in one... then later add to it to find out how performance wise it's going, I just think there'll be more server side activity than actual client side. Kame (312)
168850 2003-08-20 03:41:00 When a page is requested by a browser, the page is what it will get. The httpd server sends the page. It doesn't (can't) know what parts of the page you want. If the page is 4kB, it will load quickly. If it is 5 MB it will load slowly. Graham L (2)
168851 2003-08-20 07:27:00 If they request a page e.g. index.php then the server turns to the interpreter first which then outputs HTML code so the browser can view it. To me it should not matter if the page is filled with 5MB of scripts (that's a lot of code) as the interpreter should realise what it's suppose to output and then when some clicks a link, another trip back to the interpreter to understand what it has to do next. If it were an Static HTML page, you could expect huge delay, and I don't think what I'm wanting to do is possible in Static HTML, it really needs to be dynamic.

As usual with most things I attempt they never work out, so I'll update on my discovery in trying to do this.

I think the server's processor will take a bit, but hopefully nothing too dramatic.
Kame (312)
168852 2003-08-20 08:36:00 You're correct in that the server will only send out the parts you're wanting.

I'd seriously look at a database (MySQL). Also look at using includes where it will read the text in a text file and do with it what you like.
-=JM=- (16)
1