1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. To chat with the GameOgre community, you need to have at least 100 posts. Once you have the 100 posts, post at Become A New Ogre
    Dismiss Notice

why code don't work?

Discussion in 'Online Game Development' started by rtkwar, Nov 27, 2011.

Thread Status:
Not open for further replies.
  1. shugo

    shugo Elite Ogre Ogre Veteran

    Messages:
    2,093
    Likes Received:
    12
    Trophy Points:
    38
    Credit:
    15,528.42
    what kind of error? A syntax error, or something else? Could you show me?
     
    Last edited by a moderator: Dec 16, 2011
  2. rtkwar

    rtkwar Big Brute New Ogre

    Messages:
    142
    Likes Received:
    1
    Trophy Points:
    18
    Credit:
    298.66
    thats code:
    and thats error:
     
  3. shugo

    shugo Elite Ogre Ogre Veteran

    Messages:
    2,093
    Likes Received:
    12
    Trophy Points:
    38
    Credit:
    15,528.42
    have you tried this instead?

    Code:
    
    <?php
    $int = 123;
    
    if(filter_var($int, FILTER_VALIDATE_INT))
    {
    echo "Integer is valid";
    }
    else
    {
    echo "Integer is not valid";
    }
    ?> 
    
    
    and try it on the server, not your own computer (though if it is core, it shouldn't matter, but better safe than sorry)

    I suspect that the ( in the echo is causing the problems. You shouldn't echo ("") like that, but like this ""

    with () around the echo php thinks that being echoed is a function, which it isn't of course

    ! shouldn't cause problems, but try it without it anyway to see what it affects, if any

    A last possible explanation is that php isn't installed on that server.
     
    Last edited by a moderator: Dec 17, 2011
Thread Status:
Not open for further replies.

Share This Page