Thread
:
index.php?page=aboutme
View Single Post
01-25-2007, 08:08 PM
· #
1
thestudent
NamePros Regular
Name: nujaim
Location: pakistan
Trader Rating: (
4
)
Join Date: Aug 2005
Posts: 303
NP$: 219.95 (
Donate
)
index.php?page=aboutme
Hi,
Some people wonder how they can make their pages look like:
http://mysite.com/index.php?page=aboutme
so here's a tutorial I wrote on it.
Code:
<?PHP
// Sample script written by Daynah
// PHP-Princess.net
// Where all your text files are located at
$directory = 'version2/';
// If the variable exists
// Example: If the url is index.php?page=aboutme
if($page)
{
// Does the file $directory/$page.txt exist?
if(is_file("$directory$page.txt"))
include("$directory$page.txt");
else
print "Sorry, this page does not exist";
}
// If the page is just called as index.php
// Then just include the default main.txt page
else
{
$mypage = 'main.txt';
include("$directory$mypage");
}
?>I also attached a zip file that has all the files in it's proper directory. Unzip it, put it on your domain. Then go to the index.php site. Ex.
http://yourdomain.php/phpsample1/index.php
You can go and edit
http://yourdomain.php/phpsample1/version2/main.txt
or
http://yourdomain.php/phpsample1/version2/aboutme.txt
if you like.
If you want to add more files so you can call the page like:
http://yourdomain.php/phpsample1/ind...page=downloads
Just add another file called downloads.txt to the version2 directory. Test it out and see if it works. If you need more help, please post here.
You can download the files here
Please
register or
log-in
into NamePros to hide ads
__________________
Your Site(s) In 200 Social BookMark Sites + 50 Directory Submit -10$ ONLY
Tamplates Blog
thestudent
View Public Profile
Send a private message to thestudent
Find More Posts by thestudent
Add thestudent to Your Buddy List
Nominate for Member of the Month
Site Sponsors
Advertise your business at NamePros
All times are GMT -7. The time now is
08:07 AM
.
-- NamePros - vBulletin 3
---- DigiPawn Skin
---- RickLatona.com Skin
---- Violet
Advertise At NamePros
-
Contact Us
-
NamePros.Com
-
Archive
-
Privacy Statement
-
Top
Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.