| | |
index.php?p="Whatever"
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2004
Posts: 234
Reputation:
Solved Threads: 8
It's using function. You may take a look at http://www.phpfreaks.com/tutorials/1/0.php
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 =]
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
PHP
Languages this technical polyglot is working on:
C++
Java
XML
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
PHP
Languages this technical polyglot is working on:
C++
Java
XML
I'm not really familiar with PHP, but I imagine the code would look something like this:
The above could be used for the index page. The following would be used for the links.
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:
PHP Syntax (Toggle Plain Text)
<!-- All your header stuff --> <?php if ($content){ require("$content"); } else { require('defaultcontent'); // replace defaultcontent with whatever file. } ?> <!-- 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)
<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)
----------
http://www.vaporone.com (THE LEGEND)
http://www.candycola.com (FREE MUSIC)
http://www.pdunderground.com (THE UNDERGROUND)
•
•
Join Date: Jul 2004
Posts: 11
Reputation:
Solved Threads: 1
•
•
•
•
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:
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.
•
•
Join Date: Feb 2003
Posts: 282
Reputation:
Solved Threads: 6
[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. )
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. )
Good point, Roberdin.
Alcides.
Alcides.
Vapor One
----------
http://www.vaporone.com (THE LEGEND)
http://www.candycola.com (FREE MUSIC)
http://www.pdunderground.com (THE UNDERGROUND)
----------
http://www.vaporone.com (THE LEGEND)
http://www.candycola.com (FREE MUSIC)
http://www.pdunderground.com (THE UNDERGROUND)
![]() |
Similar Threads
- HTACCESS : Remove "index.php?" from all url (Linux Servers and Apache)
- Cannot redirect webpage after removing "index.php" from url (JavaScript / DHTML / AJAX)
Other Threads in the PHP Forum
- Previous Thread: Eteamz like functionality
- Next Thread: WEIRD! php pages do not load unless i hit refresh
| Thread Tools | Search this Thread |
# 5.2.10 access alexa apache api array beginner binary broken cakephp checkbox class clean clients cms code cron curl database date directory display dissertation dynamic echo echo$_get[x]changingitintovariable... email encode error fairness file files folder form forms function functions google href htaccess html image images include indentedsubcategory insert ip javascript joomla legislation limit link local login mail memberships menu mlm multiple multipletables mysql mysqlquery newsletters oop open paypal pdf persist php problem provider query radio random recursion remote rss script search server sessions sms sockets source space spam sql syntax system table tutorial update upload url validator variable video web youtube





