note 109474 modified in function.header by danbrown
| From: | danbrown@php.net | Date: | Fri, 20 Jul 2012 14:46:06 +0000 |
| Subject: | note 109474 modified in function.header by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-189323@lists.php.net to get a copy of this message | ||
You can use header(); function to show programs Errors for
example //
Errors.php <?php if(isset($_GET['iderror'])) { echo
'<div
align="center">'; switch($_GET['iderror']) { case
1: echo "we can not found your username or
password"; breaak; case 2: echo
"please login"; break; } echo
'</div>'; } else { echo
"please send your Errors
code"; } ?> //panel.php <?php //
... if($_SESSION['access'] ==
"") { header("Location:
Errors.php?id=1"); } if($_SESSION['username']
== "") { header("Location:
Errors.php?id=2"); } ?>
--was--
You can use header(); function to show programs Errors
for example
// Errors.php
<?php
if(isset($_GET['iderror']))
{
echo '<div align="center">';
switch($_GET['iderror'])
{
case 1:
echo "we can not found your username or password";
breaak;
case 2:
echo "please login";
break;
}
echo '</div>';
}
else
{
echo 'please send your Errors code";
}
?>
//panel.php
<?php
...
if($_SESSION['access'] == "")
{
header("Location: Errors.php?id=1");
}
if($_SESSION['username'] == "")
{
header("Location: Errors.php?id=2");
}
?>
http://php.net/manual/en/function.header.php