SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Wizard rctneil's Avatar
    Join Date
    Jun 2005
    Posts
    1,898
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Where have I gone wrong?

    Whats gone funny in this:

    PHP Code:
    <?php  if (($_SESSION['logged']) == 1) {
                    echo 
    '&nbsp;<font class="nav"><a class="nav" href="'$project_path'membership.php">'($_SESSION['username'])' is logged in.</a></font>';
                    } else echo 
    '&nbsp;<font class="nav"><a class="nav" href="'$project_path 'membership.php">You are not logged in.</a></font>'
          
    ?>
    Thankyou

    Neil

  2. #2
    SitePoint Guru
    Join Date
    Oct 2006
    Location
    Queensland, Australia
    Posts
    852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Please explain the problem you are having. You'll find you get more help if you put a bit of effort into your posts.

  3. #3
    SitePoint Wizard rctneil's Avatar
    Join Date
    Jun 2005
    Posts
    1,898
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm getting this error:

    Parse error: parse error, unexpected T_VARIABLE, expecting ',' or ';' in C:\Documents and Settings\Neil\My Documents\www\template atm\includes\navbar.inc.php on line 66

    line 66 is the second line down in that post.

    Thanks and Sorry

    Neil

  4. #4
    Dinah-Moe Humm mudshark's Avatar
    Join Date
    Dec 2003
    Posts
    1,072
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Some concatenation errors; also added curly brackets to your else...
    PHP Code:
    <?php  if ($_SESSION['logged'] == 1) {
                    echo 
    '&nbsp;<font class="nav"><a class="nav" href="'.$project_path.'membership.php">'.$_SESSION['username'].' is logged in.</a></font>';
                    } else { echo 
    '&nbsp;<font class="nav"><a class="nav" href="'.$project_path 'membership.php">You are not logged in.</a></font>';  }
          
    ?>

  5. #5
    SitePoint Wizard rctneil's Avatar
    Join Date
    Jun 2005
    Posts
    1,898
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks,

    Can you check this one as well?

    PHP Code:
    echo '<div class="center"><img src="'$project_path $getareadata['titleimage'] . '" /></div>'
    Thanks

    Neil

  6. #6
    SitePoint Enthusiast
    Join Date
    Mar 2006
    Location
    Michigan
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    echo '<div class="center"><img src="' $project_path $getareadata['titleimage'] . '" /></div>'
    You forgot the . before $project_path

  7. #7
    SitePoint Wizard rctneil's Avatar
    Join Date
    Jun 2005
    Posts
    1,898
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cheers!

  8. #8
    SitePoint Wizard rctneil's Avatar
    Join Date
    Jun 2005
    Posts
    1,898
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Now this is not working?

    PHP Code:
    <img src="<?php echo ($project_path 'img/page headings/areareview.png') ; ?>" alt="Area Review:" />

  9. #9
    Dinah-Moe Humm mudshark's Avatar
    Join Date
    Dec 2003
    Posts
    1,072
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just get rid of the brackets on your echo command - they're optional anyway.

  10. #10
    Dinah-Moe Humm mudshark's Avatar
    Join Date
    Dec 2003
    Posts
    1,072
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh and btw: it's not a good idea to have spaces in folder- or filenames...

  11. #11
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by rctneil
    Now this is not working?
    in the future, try not to say "not working" or "doesnt work" etc..., as it gives people very little information to help you. be specific.

    you know what caused you to think something is wrong, and you should explain it. if your getting a php error message, cut and paste it.

    putting some effort into your posts will go a long way towards people helping you.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •