Go4Expert

Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   php code problem (http://www.go4expert.com/forums/php-code-problem-t6785/)

yoyoo 11Oct2007 20:53

php code problem
 
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;
        }
}

    
?>


pete_bisby 16Nov2007 00:47

Re: php code problem
 
..... 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.


All times are GMT +5.5. The time now is 09:16.