php problem

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

  1. yoyoo

    yoyoo New Member

    Joined:
    Oct 11, 2007
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    0
    hi guy can anybody sport the error

    i get these error msg when i run the programme
    Parse error: syntax error, unexpected $end in C:\wamp\www\nalanda\~phpdesigner_output_tmp.php on line 36 line 36 is at the end of the scritp
    what could be the problem



    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 $www;
            include("style.html");
            ?>
                <html><head><title>Must Be admin</title>
                <meta http-equiv="Refresh"
                    content="5 ; URL=<?=$www?>/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="<?=$www?>/userf/login.php">Login Page</a> in 5 seconds
                </center></body></html>

            <?
            exit;
            }
    }    
    ?>
     
    Last edited by a moderator: Oct 24, 2007
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Now having so many posts you should know how to post the code in the posts and I would suggest you go through the Hints before you make a post.
     
  3. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,645
    Likes Received:
    87
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in
    I think the problem is the tendency to switch back and forth between <?php and <?. If short_tags is turned off (because it has been deprecated), then the bits between <?...?> will be ignored by the parser, and that would cause problems. Indeed, replacing <? with <?php clears the error.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice