index.php?p="Whatever"

Reply

Join Date: Aug 2004
Posts: 3
Reputation: imzac is an unknown quantity at this point 
Solved Threads: 0
imzac imzac is offline Offline
Newbie Poster

index.php?p="Whatever"

 
0
  #1
Aug 3rd, 2004
Does anyone know where I can learn to base my entire web site off of one index page? I can't seem to find anything.
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 234
Reputation: PoA is an unknown quantity at this point 
Solved Threads: 8
PoA PoA is offline Offline
Posting Whiz in Training

Re: index.php?p="Whatever"

 
0
  #2
Aug 3rd, 2004
It's using function. You may take a look at http://www.phpfreaks.com/tutorials/1/0.php
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 9
Reputation: kenleycapps is an unknown quantity at this point 
Solved Threads: 0
kenleycapps's Avatar
kenleycapps kenleycapps is offline Offline
Newbie Poster

Re: index.php?p="Whatever"

 
0
  #3
Aug 4th, 2004
I know exactly what you want and I'm currently working on a tutorial to further explain in detail what one needs to understand/do to create a single file used to load other files, or a page to load other pages for a website.

It should be ready by tomorrow night. I'll be covering the query string, superglobals, dynamic file including, and basic security, all of which are involved and required when dealing with a dynamic page loader.

It's my first tutorial so I hope it works out well =]
Current languages this technical polyglot knows:
PHP

Languages this technical polyglot is working on:
C++
Java
XML
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 3
Reputation: imzac is an unknown quantity at this point 
Solved Threads: 0
imzac imzac is offline Offline
Newbie Poster

Re: index.php?p="Whatever"

 
0
  #4
Aug 4th, 2004
That would be great. I REALLY need to see that. It would help a lot.
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 9
Reputation: kenleycapps is an unknown quantity at this point 
Solved Threads: 0
kenleycapps's Avatar
kenleycapps kenleycapps is offline Offline
Newbie Poster

Re: index.php?p="Whatever"

 
0
  #5
Aug 5th, 2004
sorry imzac. the tutorial will have to wait. the final copy is 25% complete but I just ran into some problems (real life problems =\ ) so I will attempt to have it ready by tomorrow night. Keep checking back; I'll be providing plenty of tutorials (depending on how my first one goes) in the next few months. Sorry again!
Current languages this technical polyglot knows:
PHP

Languages this technical polyglot is working on:
C++
Java
XML
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 3
Reputation: imzac is an unknown quantity at this point 
Solved Threads: 0
imzac imzac is offline Offline
Newbie Poster

Re: index.php?p="Whatever"

 
0
  #6
Aug 5th, 2004
Well, does anyone else know anything that would help me?
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 54
Reputation: Alcides is an unknown quantity at this point 
Solved Threads: 0
Alcides's Avatar
Alcides Alcides is offline Offline
Junior Poster in Training

Re: index.php?p="Whatever"

 
0
  #7
Aug 7th, 2004
I'm not really familiar with PHP, but I imagine the code would look something like this:

  1.  
  2. <!-- All your header stuff -->
  3.  
  4. <?php
  5. if ($content){
  6. require("$content");
  7. } else {
  8. require('defaultcontent'); // replace defaultcontent with whatever file.
  9. }
  10. ?>
  11.  
  12. <!-- All your footer stuff -->

The above could be used for the index page. The following would be used for the links.

  1.  
  2. <a "href=www.domain.com/index.php?content=aboutme.con">About Me.</a>

Anyone else have any feedback on this. I just came up with this on the fly from the little I do know about PHP. I didn't test this.

Alcides. :rolleyes:
Vapor One
----------
http://www.vaporone.com (THE LEGEND)
http://www.candycola.com (FREE MUSIC)
http://www.pdunderground.com (THE UNDERGROUND)
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 11
Reputation: rice_web is an unknown quantity at this point 
Solved Threads: 1
rice_web rice_web is offline Offline
Newbie Poster

Re: index.php?p="Whatever"

 
0
  #8
Aug 9th, 2004
Originally Posted by Alcides
Anyone else have any feedback on this. I just came up with this on the fly from the little I do know about PHP. I didn't test this.

Alcides. :rolleyes:
That's about right. I mean, obviously, it can get pretty complicated, as in my two software projects (sorry, only one's open source, and the open source one is incomplete at that).

http://www.daku.info/products/site_file_lite.html (just a beta)
http://www.minot.k12.nd.us/buildings

You may not notice it, but the second page is still justing using a base index.php file and employs page IDs beyond that point. However, it also uses error pages to redirect to index.php using shortcuts for each page. It's an elaborate, database-driven setup, but it allows us a great deal of flexibility, such as web-based administration.
Reply With Quote Quick reply to this message  
Join Date: Feb 2003
Posts: 282
Reputation: Roberdin will become famous soon enough Roberdin will become famous soon enough 
Solved Threads: 6
Team Colleague
Roberdin Roberdin is offline Offline
Supreme Evil Overlord

Re: index.php?p="Whatever"

 
0
  #9
Aug 9th, 2004
[php]require("$content");[/php]
This'll work, but it's a waste of the script interpreter's time:

[php]require($content);[/php]
This is faster. (Without the double quotes this time - the double quotes tell the interpreter that there may be variables embedded in the string, and should evaulate those variables, so it goes searching for them. This takes marginally more time than knowing that they are there already. Obviously, it won't make much difference, but its good to know. )
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 54
Reputation: Alcides is an unknown quantity at this point 
Solved Threads: 0
Alcides's Avatar
Alcides Alcides is offline Offline
Junior Poster in Training

Re: index.php?p="Whatever"

 
0
  #10
Aug 9th, 2004
Good point, Roberdin.

Alcides.
Vapor One
----------
http://www.vaporone.com (THE LEGEND)
http://www.candycola.com (FREE MUSIC)
http://www.pdunderground.com (THE UNDERGROUND)
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC