Welcome to Virtual Pet List!

Wanting to join the rest of our members? Feel free to sign up today. Like what you see? Then join our community! You'll love it! Its free!

Sign Up
  1. virtual pet mascot

    Virtual Pets

    Welcome to the Virtual Pet list forum!
    We're a virtual pets and sim games community and the largest forum in our industry. Game owners can use our forum to their advatange by promoting/advertising their games to our users and receive feedback/reviews from those members that try their games out. We support developers of all kinds from RPG developers, sim game developers to virtual pet site developers. We want to see more games in our industry come across more success and that's why we try our best to release as many guides/articles regarding online gaming development as we can.
    We're unlike other forums in our industry because we try our best to be there for our users no matter what and give them advice whenever they ask for it. Running an online game isn't an easy task, but with our many resources that we've built since 2011, you'll learn a lot from our online community. Please don't ever be afraid to ask a question on the forums because if you never ask, then you'll never receive an answer to your question and you can only improve by asking other users for help/advice.
    We have a lot of virtual pet sites' owners and sim game owners that are very frequent visitors on our online community. Along with artists, writers and programmers that come here looking for work and games to work for. Our members who are artists sell art in our art marketplace and programmers are allowed to sell their scripts in the programming marketplace. We also allow game owners to sell their game in our general marketplace
    In early 2011, we decided to make a comeback to the internet because in 2010, we had a minor setback and we had to re-launch without any content, but with a lot of time, patience, hardwork and effort, we've managed to rebuild the Virtual pet list community into something better than it was before. We actually registered our domain name on November 4th, 2004, but we were only a directory then and all we had was a basic comments system for users to post things on their favorite games..
    So, what are you waiting for, why don't you join today? If you have any problems figuring out our security code, then here's a hint, it has millions upon users and has been around since 1997.
    Our list of virtual pet sites and directory of sim games have a lot of different games listed, so we're pretty sure that you may find some games that suits your needs as a player of sim games or virtual pet sites.
    If you're still curious about a certain game that you'd like to play, then please check out some of our game reviews that were written by some of our great contributors and our interviews with respective virtual pet site owners, sim game owners, artists, writers and programmers that have worked in this industry.

  2. Check out our latest guide on how to grow your user base!
    Paladore - Boopets - Icepets - Corepets open beta
    Virtual Pet Directory
    Are you looking for new virtual pet sites or sim games to play?

Help...?

Discussion in 'Programming General' started by Moonlight, Jun 4, 2011.

  1. Moonlight
    Offline

    Moonlight Approved Artist Web Designer Approved Artist VPL Member

    Reputations:
    2
    Joined:
    Jan 28, 2011
    Messages:
    657
    Likes Received:
    12
    Trophy Points:
    28
    Location:
    Earth
    Anyway, I have a navigation system, and it gives me this error:

    Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/a1728691/public_html/includes/functions.php on line 21

    The php code to show it is:

    PHP:
    <?php navigation(); ?>
    And the function [This is part of a "bigger" part of coding, thus there is no <?php and ?> tags as they come earlier/later on.]:

    PHP:
    function navigation()
    {
        if( 
    is_logged_in() ){
            echo 
    '<a href='index.php'>Home</a><br />';
            echo 
    '<a href='news.php'>News</a><br />';
            echo 
    '<a href='logout.php'>Logout</a><br />';    
        } else {
            echo 
    '<a href='index.php'>Home</a><br />';
            echo 
    '<a href='login.php'>Login</a><br />';
            echo 
    '<a href='signup.php'>Signup</a><br />';   
            echo 
    '<a href='news.php'>News</a><br />';
        }
    }
     
  2. Avalanche
    Offline

    Avalanche Supporter VPL Supporter

    Reputations:
    0
    Joined:
    May 30, 2011
    Messages:
    428
    Likes Received:
    82
    Trophy Points:
    0
    Location:
    USA
    It may be possible using the single quotes in the link as well as in the echo is messing something up.

    PHP:
    function navigation() 

        if( 
    is_logged_in() ){ 
            echo 
    '<a href="index.php">Home</a><br />'
            echo 
    '<a href="news.php">News</a><br />'
            echo 
    '<a href="logout.php">Logout</a><br />';     
        } else { 
            echo 
    '<a href="index.php">Home</a><br />'
            echo 
    '<a href="login.php">Login</a><br />'
            echo 
    '<a href="signup.php">Signup</a><br />';    
            echo 
    '<a href="news.php">News</a><br />'
        } 
    }  
    Try using the double quotes instead? It won't mess up the HTML. Notice how using the double quotes changes the color of the links. I'm pretty sure that's what is causing your error.
     
  3. Noma
    Offline

    Noma New Member VPL Member

    Reputations:
    0
    Joined:
    May 24, 2011
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    NJ, USA
    @Avalanche's solution should solve the problem. The reason the links are changing color is your quotes are excluding the links from the original quotations, making them just part of the code and not part of the link reference.
     
    Last edited by a moderator: Oct 16, 2013
  4. Avalanche
    Offline

    Avalanche Supporter VPL Supporter

    Reputations:
    0
    Joined:
    May 30, 2011
    Messages:
    428
    Likes Received:
    82
    Trophy Points:
    0
    Location:
    USA
    @Noma - yeah that's the more official way of saying it. XD But then when PHP doesn't detect a ';' or ',' after it thinks the echo statement has ended it sends and error.
     
    Last edited by a moderator: Oct 16, 2013
  5. Noma
    Offline

    Noma New Member VPL Member

    Reputations:
    0
    Joined:
    May 24, 2011
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    NJ, USA
    I wasn't correcting you, just agreeing =]
     
  6. Moonlight
    Offline

    Moonlight Approved Artist Web Designer Approved Artist VPL Member

    Reputations:
    2
    Joined:
    Jan 28, 2011
    Messages:
    657
    Likes Received:
    12
    Trophy Points:
    28
    Location:
    Earth
    Thank you! It works.
     
  7. Avalanche
    Offline

    Avalanche Supporter VPL Supporter

    Reputations:
    0
    Joined:
    May 30, 2011
    Messages:
    428
    Likes Received:
    82
    Trophy Points:
    0
    Location:
    USA
    Last edited by a moderator: Oct 16, 2013
  8. jibbles
    Offline

    jibbles New Member VPL Member

    Reputations:
    0
    Joined:
    May 10, 2011
    Messages:
    150
    Likes Received:
    1
    Trophy Points:
    0
    Location:
    UK
    An alternative solution is to escape the single quotes. By putting a backslash before the quote mark it tells php that this isn't the end of the string. The backslash itself won't be echo'd.
    PHP:
    function navigation()
    {
        if( 
    is_logged_in() ){
            echo 
    '<a href=\'index.php\'>Home</a><br />';
            echo 
    '<a href=\'news.php\'>News</a><br />';
            echo 
    '<a href=\'logout.php\'>Logout</a><br />';    
        } else {
            echo 
    '<a href=\'index.php\'>Home</a><br />';
            echo 
    '<a href=\'login.php\'>Login</a><br />';
            echo 
    '<a href=\'signup.php\'>Signup</a><br />';   
            echo 
    '<a href=\'news.php\'>News</a><br />';
        }
    }
     

Share This Page