Page ID. (i.e. index.php?id=1)

By noodle8 on Sep 17, 2006

This is a quicky script I made in 2 mins! You can create pages like:

index.php?id=1 or index.php?id=forums

If you have any problems or need help with scripting, just Pm me ;)

First. Create the page you want to do the ?id=(number or variable here).
Ill do index.php.
---------------
<?php
$id = $_GET['id'];
if($id == 1){
echo "Welcome to the first page!";
}
if($id == forums){
echo "Redirecting you to the forums...please wait.
<meta 
http-equiv=refresh content=5; url=http://your_domain.com/forums>";
}
?>
---------------
You can add content to the top or bottom or middle of every page by putting text between the if($id's.
You can obviously create more by copying the 

if($id == forums){
echo "Redirecting you to the forums...please wait.
<meta 
http-equiv=refresh content=5; url=http://your_domain.com/forums>";
}

and editing it accordingly.

Comments

Sign in to comment.
dawsoninvestment   -  Nov 10, 2006

I need to generate mailers to send mail messages

 Respond  
Mpdreamz   -  Oct 02, 2006

Same here all my ID\'s are numeric and represent dbase values, so i just check if (is_numeric($_REQUEST[\'id\'])) {

 Respond  
TeQh   -  Oct 01, 2006

man... I use the $id sometimes, but remember stripslashes() and also I use a mysql db e.g. associate id to a page that I add in the database and when you do the $id= it searches my mysql page for that id and if it finds that one it uses the page field and brings up the site... also, if $id doesn\'t exist in the database it brings up a \"this page has been moved or your smoking crack\" page... just throwing my input.. I could post my mysql script, but its a 3 part script.. with admin section addon, lol

 Respond  
noodle8   -  Sep 25, 2006

Oh...ok...

 Respond  
F*U*R*B*Y*   -  Sep 20, 2006

http://hawkee.com/snippet.php?snippet_id=1077 <-------- both are good, i preffer cooolstars just i find it easy to use, maybe you could turn this into a tutorial and post it in the php scripting area ;)

 Respond  
Hawkee   -  Sep 17, 2006

You can also use a switch statement with the $id variable rather than if-statements. Also, be very careful not to include($id) because this is a serious security hazard that can cause your site to be exploited.

 Respond  
noodle8   -  Sep 17, 2006

I dunno. I just used that was a quick example of what you could do. Good idea tho.

 Respond  
krimson   -  Sep 17, 2006

why use iframes when you can include the specific page or redirect to it?

 Respond  
noodle8   -  Sep 17, 2006

Any comments?

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.