944,008 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 4752
  • PHP RSS
Aug 3rd, 2004
0

index.php?p="Whatever"

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
imzac is offline Offline
3 posts
since Aug 2004
Aug 3rd, 2004
0

Re: index.php?p="Whatever"

It's using function. You may take a look at http://www.phpfreaks.com/tutorials/1/0.php
PoA
Reputation Points: 19
Solved Threads: 9
Posting Whiz in Training
PoA is offline Offline
234 posts
since Jul 2004
Aug 4th, 2004
0

Re: index.php?p="Whatever"

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 =]
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kenleycapps is offline Offline
9 posts
since Aug 2004
Aug 4th, 2004
0

Re: index.php?p="Whatever"

That would be great. I REALLY need to see that. It would help a lot.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
imzac is offline Offline
3 posts
since Aug 2004
Aug 5th, 2004
0

Re: index.php?p="Whatever"

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!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kenleycapps is offline Offline
9 posts
since Aug 2004
Aug 5th, 2004
0

Re: index.php?p="Whatever"

Well, does anyone else know anything that would help me?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
imzac is offline Offline
3 posts
since Aug 2004
Aug 7th, 2004
0

Re: index.php?p="Whatever"

I'm not really familiar with PHP, but I imagine the code would look something like this:

PHP Syntax (Toggle Plain Text)
  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.

PHP Syntax (Toggle Plain Text)
  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:
Reputation Points: 11
Solved Threads: 0
Junior Poster in Training
Alcides is offline Offline
54 posts
since Jul 2004
Aug 9th, 2004
0

Re: index.php?p="Whatever"

Quote 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.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
rice_web is offline Offline
11 posts
since Jul 2004
Aug 9th, 2004
0

Re: index.php?p="Whatever"

[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. )
Team Colleague
Reputation Points: 63
Solved Threads: 6
Supreme Evil Overlord
Roberdin is offline Offline
282 posts
since Feb 2003
Aug 9th, 2004
0

Re: index.php?p="Whatever"

Good point, Roberdin.

Alcides.
Reputation Points: 11
Solved Threads: 0
Junior Poster in Training
Alcides is offline Offline
54 posts
since Jul 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Eteamz like functionality
Next Thread in PHP Forum Timeline: WEIRD! php pages do not load unless i hit refresh





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC