Hi,
what i am looking for is when some one looks at my page "error.php?err=1" it will show whatever i have set for that. same with other numbers as well. i hope that is not confusing...
thanks in advanced!
Display diffrent text depending on url
Moderator: General Moderators
- aaronhall
- DevNet Resident
- Posts: 1040
- Joined: Tue Aug 13, 2002 5:10 pm
- Location: Back in Phoenix, missing the microbrews
- Contact:
Something simple:
Code: Select all
<?
// here's where you set your errors
$errorArray[1] = "There is an error!";
$errorArray[2] = "This is another error!";
$errorArray[3] = "Ugh, yet another";
if(is_numeric($_GET['err'])) { // check that $_GET['err'] is numeric, and not a hijack attempt
if(!empty($errorArray[$_GET['err']])) { // check that this error number exists
echo "ERROR: " . $errorArray[$_GET['err']]; // print the error
}
}
?>