A Http://domain.com/index.php?page=blabla
#1
Posted 05 May 2005 - 02:59 AM
or http://overthehills.com/?id=123info
I need the source to place on my website and what to do in order to use it properly.
I searched the forums/database but everytime I tried it the source kept showing errors.
#2
Posted 05 May 2005 - 03:19 AM
I am a php NUBBEEEEEEE/NEWBIEEEEE
#3
Posted 05 May 2005 - 08:41 AM
<?php if( !$id ) { echo"the main text if you goto index.php or what ever your page is called"; } else if( $id == 123info ) { echo"the text that is on ?id=123info"; } ?>
there you go, and hope it helps you.
smardy
#4
Posted 05 May 2005 - 12:00 PM
it looks very diferent than the others.......do I need to change anything?
(we are talking about the coding that I only need to make on page and all other .php files load up in a content box when I choose them, right)?
#5
Posted 05 May 2005 - 04:24 PM
#6
Posted 05 May 2005 - 04:34 PM
<?php if (file_exists($_GET['id'] . ".php")) { include $_GET['page'] . ".php"; } else { include "404.php"; } ?>
Just put that where you want your content to appear and then create any pages you want. For instance, if you had a page called hello.php, you could access it by going to index.php?id=hello. And if you want to include a page in a directory above the current one, use index.php?id=/directory/pagename.
#7
Posted 05 May 2005 - 05:37 PM
dEcade
#8
Posted 05 May 2005 - 06:24 PM
#9
Posted 05 May 2005 - 06:37 PM
Warning: main(.php) [function.main]: failed to open stream: No such file or directory in /home/oncecfh/public_html/index.php on line 12
Warning: main() [function.include]: Failed opening '.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/oncecfh/public_html/index.php on line 12
#10
Posted 06 May 2005 - 12:02 PM
http://www.drk-alias...CODE=view&id=10
hope it helps.
#11
Posted 06 May 2005 - 09:47 PM
#12
Posted 07 May 2005 - 06:12 AM
Ps: i was updating the forum security n somethin happened but fixin it as i speak, check bac in an hour or two.
I need some more members n people requestin for help
#13
Posted 07 May 2005 - 06:45 AM
#14
Posted 07 May 2005 - 07:14 AM
<?php $id = $_GET['id']; switch($id) { case "home": include('home.php'); break; case "page": include('page.php'); break; case "page2": include('otherpage.php'); break; case "contact": include('contact.php'); default: include('home.php'); } ?>
Change id to whatever u want to use e.g. if u replace id with page it will be index.php?page=urpage$id = $_GET['id'];
the page name so that will be x.php?id=home change home to main n it will be index.php?id=maincase "home":
is the link to the pageinclude('page.php');
main site page so if your main page is main.php change home.php to main.phpdefault:
include('home.php');
if user enters index.php?id=blabla it will take them to that page
To add a new page just add
before default:break; case "thepageid":
include('page.extension');
:: Summary ::
After you do this you will be able to get to your pages via index.php?id=page
thats wats supposed to be on my site, but might take longer than i wanted to fix,
#15
Posted 07 May 2005 - 07:26 AM
ty, someone who actually knows the real waycreate a file called index.php with the following php code
<?php $id = $_GET['id']; switch($id) { case "home": include('home.php'); break; case "page": include('page.php'); break; case "page2": include('otherpage.php'); break; case "contact": include('contact.php'); default: include('home.php'); } ?>Change id to whatever u want to use e.g. if u replace id with page it will be index.php?page=urpage$id = $_GET['id'];
the page name so that will be x.php?id=home change home to main n it will be index.php?id=maincase "home":
is the link to the pageinclude('page.php');
main site page so if your main page is main.php change home.php to main.phpdefault:
include('home.php');
if user enters index.php?id=blabla it will take them to that page
To add a new page just addbefore default:break; case "thepageid":
include('page.extension');
:: Summary ::
After you do this you will be able to get to your pages via index.php?id=page
thats wats supposed to be on my site, but might take longer than i wanted to fix,
#16
Posted 07 May 2005 - 10:29 AM
#17
Posted 07 May 2005 - 12:58 PM
I used back in 2003 one time but forgot it when I gave up my site to a friend.........thankyou.
#18
Posted 07 May 2005 - 01:11 PM
The one by Dark is more secure than the rest, so good choicei will try the one by dark.....hopefully it will work
I used back in 2003 one time but forgot it when I gave up my site to a friend.........thankyou.
#19
Posted 07 May 2005 - 04:31 PM
<?php if(!$id){ echo ' this is with nothing typed in'; } if($id == '123info'){ echo 'This is if you put ?id=123info'; } ?>
and if you want more than 1 variable like ?id=123info&user=2 you can use this:
<?php if($id == '123info' && $user == '2'){ echo 'this is if you put in ?id=123info&user=2'; } elseif($id == '123info'){ echo 'This is if you put ?id=123info'; } elseif(!$id){ echo ' this is with nothing typed in'; } ?>
Try that out, it should work.
Also you know that you need to have a server that supports php.
I tested both myself and they work.
dEcade
#20
Posted 09 May 2005 - 12:29 PM
or a different page:http://cloud09.org/index.php?c9=different
am I right???
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users