1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

php code problem

Discussion in 'PHP' started by yoyoo, Oct 11, 2007.

  1. yoyoo

    yoyoo New Member

    okay i got these code it gives me an error once i try to compile it anybody to help please
    PHP:
    <?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 a moderator: Nov 16, 2007
  2. pete_bisby

    pete_bisby New 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.
     

Share This Page