Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Dec 2005
    Posts
    702
    Thanks
    0
    Thanked 0 Times in 0 Posts

    error below appears in the line 1502, where may be the problem ?

    error below appears in the line 1502, where may be the problem ? appear when add $a2 & $_SESSION['a2'], where are the same values, and get values from a form(dynamically appear a2 textbox when a select box is in selectedIndex=3)...

    line 1502:
    Code:
        <td>&nbsp;<?php echo date("H:i l F dS, Y", $dated); ?>&nbsp; to &nbsp;<?php (isset($_SESSION['a2'])) ? echo "$Locationd ($a2)" : echo "$Locationd";   ?></td>

    Parse error: syntax error, unexpected T_ECHO in /home/content/p/o/l/polisch123/html/quote/quote1a-acc-comments.php on line 1502

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    I don't believe that ternary operators will take execution commands. Thats this part here: echo "$Locationd ($a2)" : echo "$Locationd
    So, change it like so:
    PHP Code:
        <td>&nbsp;<?php echo date("H:i l F dS, Y"$dated); ?>&nbsp; to &nbsp;<?php echo (isset($_SESSION['a2'])) ? "$Locationd ($a2)" "$Locationd";   ?></td>
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #3
    Regular Coder
    Join Date
    Dec 2005
    Posts
    702
    Thanks
    0
    Thanked 0 Times in 0 Posts

    error disappears but nothing printed on screen , well ?

    error disappears but nothing printed on screen , well ?

  • #4
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    You forgot to echo

  • #5
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Quote Originally Posted by Fumigator View Post
    You forgot to echo
    That would also be my assumption. Thats the benefit of a ternary operator, you know that it will return a result unless its a failed resource command (which will generally return null, which equates to else, so will probably still return a result).
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 


  •  

    Posting Permissions

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