Jump to content

Setting default ID


Recommended Posts

the current code is

<?php if (!isset($_REQUEST['id'])) {	 include("pages/index.inc.php"); 		 exit();}if ( $_GET['id'] == 1 ) { include("pages/index.inc.php"); }if ( $_GET['id'] == 2) { include("pages/another_page.inc.php");}?>

Now if they type an ID that is invalid i would like it to redirect them to index.php for example ID or ID= and ID=number/word whatever so it only takes them to another page if the ID is valid so index.php?id=1 would work where index.php?id=11 wouldnt, Thanx, Rswildy.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...