php code problem

yoyoo's Avatar, Join Date: Oct 2007
Light Poster
okay i got these code it gives me an error once i try to compile it anybody to help please
PHP Code:
<?php
/* A collection of commonly used functions in OnLib */

require_once("conf.php");
function 
clean($input,$maxlength)
{
$input=substr($input,0,$maxlength);
$input=Escapeshellcmd($input);
return 
$input;
}
function 
showerror()
   {
?>
<html><body><p><p><p><p><p><p>    <?
      die("Error " . mysql_errno() . " : " . mysql_error());
   }
function isadmin()
{    
    if($_SESSION['bo_id'] != "ADMIN")
        {
        global $wwwroot;
        include("style.html");
        ?>
            <html><head><title>Must Be admin</title>
            <meta http-equiv="Refresh"
                content="5 ; URL=<?=$wwwroot?>/userf/login.php">
            </head>
            <br><br><center>
            <font color="brown"><h4>Only Administerators Can Access This Page</h4></font>
            <br>You will be redirected to <a href="<?=$wwwroot?>/userf/login.php">Login Page</a> in 5 seconds
            </center></body></html>

        <?
        exit;
        }
}

    
?>

Last edited by shabbir; 16Nov2007 at 07:38.. Reason: Code block
pete_bisby's Avatar, Join Date: Nov 2007
Go4Expert Member
..... what's the error?

If it's something to do with sessions, you will need to put session_start() at the top of your code, or else your session information will not be visible.