SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Addict Hajduk's Avatar
    Join Date
    Nov 2004
    Location
    Behind you
    Posts
    357
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    syntax error, unexpected T_ENCAPSED_AND_WHITESPACE

    syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING

    For some reason I am missing the point. There is an whitespace or something missing but I would love if someone can tell me what it is because after looking at it for a while I lost it:


    PHP Code:
    <?php if($au=$_SESSION['_amember_user']){print"Welcome $au[name_f] $au[name_l]!";
    echo 
    "<a href=\"http://www.rodoslovlje.com/amember/logout.php\">Logout</a>"
    ."<h2>Navigation</h2>"
    ."<ul>"
    ."<li><a href=\"http://www.rodoslovlje.com/\">Home</a></li>"
    ."<li><a href=\"{URL->INDEX}\">{LANG->ForumList}</a></li>"
    ."<li><a href=\"http://www.rodoslovlje.com/novo/article.php\">Articles</a></li>"
    ."<li><a href=\"http://www.rodoslovlje.com/rodoslov/\">My Rodoslov</a></li>"
    ."<li><a href=\"http://www.rodoslovlje.com/slike/\">Gallery</a></li>"
    ."<li><a href=\"http://www.rodoslovlje.com/links/\">Links</a></li>"
    ."<li><a href=\"http://www.rodoslovlje.com/amember/signup.php\">SGS Membership</a></li>"
    ."<li><a href=\"http://www.rodoslovlje.com/contact/\">Contact</a></li>"
    ."<li><a href=\"http://www.rodoslovlje.com/sgsmembers\">SGS Members section</a><img src=\"http://www.rodoslovlje.com/images/premium.gif\" alt=\"\" ></li>"
    ."<li><a href=\"http://www.rodoslovlje.com/amember/member.php\">Your Account</a></li>"
    ."</ul>"
    ."<h2>Navigacija</h2>"
    ."<ul class=\"nav\">"
    ."<li><a href=\"http://www.rodoslovlje.com/sgsmembers\">SRD Clanovi</a><img src=\"http://www.rodoslovlje.com/images/premium.gif\" alt=\"\">"
    ."<li><a href=\"http://www.rodoslovlje.com/amember/member.php\">Vaš nalog</a></li>"
    ."</ul>"
    }else {print "<form method=\"post\" action='/amember/login.php'> Username:<br/> <input type=\"text\" name=\"amember_login\" size=\"10\" /> <br/> Password:<br/> <input type=\"password\" name=\"amember_pass\" size=\"10\" /> <br/> <input type=\"submit\" value='Login'/> </form>";}?>

  2. #2
    SitePoint Wizard silver trophy Jelena's Avatar
    Join Date
    Feb 2005
    Location
    Universum, 3rd Corner
    Posts
    3,000
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    <?php if($au=$_SESSION['_amember_user']){print"Welcome $au[name_f] $au[name_l]!";
    echo 
    "<a href=\"http://www.rodoslovlje.com/amember/logout.php\">Logout</a>"
    ."<h2>Navigation</h2>"
    ."<ul>"
    ."<li><a href=\"http://www.rodoslovlje.com/\">Home</a></li>"
    ."<li><a href=\"{URL->INDEX}\">{LANG->ForumList}</a></li>"
    ."<li><a href=\"http://www.rodoslovlje.com/novo/article.php\">Articles</a></li>"
    ."<li><a href=\"http://www.rodoslovlje.com/rodoslov/\">My Rodoslov</a></li>"
    ."<li><a href=\"http://www.rodoslovlje.com/slike/\">Gallery</a></li>"
    ."<li><a href=\"http://www.rodoslovlje.com/links/\">Links</a></li>"
    ."<li><a href=\"http://www.rodoslovlje.com/amember/signup.php\">SGS Membership</a></li>"
    ."<li><a href=\"http://www.rodoslovlje.com/contact/\">Contact</a></li>"
    ."<li><a href=\"http://www.rodoslovlje.com/sgsmembers\">SGS Members section</a><img src=\"http://www.rodoslovlje.com/images/premium.gif\" alt=\"\" ></li>"
    ."<li><a href=\"http://www.rodoslovlje.com/amember/member.php\">Your Account</a></li>"
    ."</ul>"
    ."<h2>Navigacija</h2>"
    ."<ul class=\"nav\">"
    ."<li><a href=\"http://www.rodoslovlje.com/sgsmembers\">SRD Clanovi</a><img src=\"http://www.rodoslovlje.com/images/premium.gif\" alt=\"\">"
    ."<li><a href=\"http://www.rodoslovlje.com/amember/member.php\">Vaš nalog</a></li>"
    ."</ul>";
    }else {print 
    "<form method=\"post\" action='/amember/login.php'> Username:<br/> <input type=\"text\" name=\"amember_login\" size=\"10\" /> <br/> Password:<br/> <input type=\"password\" name=\"amember_pass\" size=\"10\" /> <br/> <input type=\"submit\" value='Login'/> </form>";}?>
    Fali ; nakon izvrsenja poslednje linije u okviru else-a.
    -- Jelena --

  3. #3
    SitePoint Guru
    Join Date
    Jun 2004
    Location
    Finland
    Posts
    703
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You're missing a ; after the _huge_ echo statement.

    PHP Code:
    <?php
    if ($au $_SESSION['_amember_user'])
    {
        print 
    "Welcome $au[name_f] $au[name_l]!";
        
        echo 
    "
                <a href=\"http://www.rodoslovlje.com/amember/logout.php\">Logout</a>
            
                <h2>Navigation</h2>
                    
                <ul>
                    <li><a href=\"http://www.rodoslovlje.com/\">Home</a></li>
                    <li><a href=\"{URL->INDEX}\">{LANG->ForumList}</a></li>
                    <li><a href=\"http://www.rodoslovlje.com/novo/article.php\">Articles</a></li>
                    <li><a href=\"http://www.rodoslovlje.com/rodoslov/\">My Rodoslov</a></li>
                    <li><a href=\"http://www.rodoslovlje.com/slike/\">Gallery</a></li>
                    <li><a href=\"http://www.rodoslovlje.com/links/\">Links</a></li>
                    <li><a href=\"http://www.rodoslovlje.com/amember/signup.php\">SGS Membership</a></li>
                    <li><a href=\"http://www.rodoslovlje.com/contact/\">Contact</a></li>
                    <li><a href=\"http://www.rodoslovlje.com/sgsmembers\">SGS Members section</a><img src=\"http://www.rodoslovlje.com/images/premium.gif\" alt=\"\" ></li>
                    <li><a href=\"http://www.rodoslovlje.com/amember/member.php\">Your Account</a></li>
                </ul>
                        
                <h2>Navigacija</h2>
                    
                <ul class=\"nav\">
                    <li><a href=\"http://www.rodoslovlje.com/sgsmembers\">SRD Clanovi</a><img src=\"http://www.rodoslovlje.com/images/premium.gif\" alt=\"\">
                    <li><a href=\"http://www.rodoslovlje.com/amember/member.php\">Vaš nalog</a></li>
                </ul>"
    ;
    }
    else
    {
        print 
    "<form method=\"post\" action='/amember/login.php'> Username:<br/> <input type=\"text\" name=\"amember_login\" size=\"10\" /> <br/> Password:<br/> <input type=\"password\" name=\"amember_pass\" size=\"10\" /> <br/> <input type=\"submit\" value='Login'/> </form>";
    }
    ?>

  4. #4
    Wadge! F4nat1c's Avatar
    Join Date
    Oct 2005
    Location
    South Wales, UK
    Posts
    1,134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    <?php if($au=$_SESSION['_amember_user']){print"Welcome $au[name_f] $au[name_l]!";
    echo 
    "<a href=\"http://www.rodoslovlje.com/amember/logout.php\">Logout</a>"
    ."<h2>Navigation</h2>"
    ."<ul>"
    ."<li><a href=\"http://www.rodoslovlje.com/\">Home</a></li>"
    ."<li><a href=\"{URL->INDEX}\">{LANG->ForumList}</a></li>"
    ."<li><a href=\"http://www.rodoslovlje.com/novo/article.php\">Articles</a></li>"
    ."<li><a href=\"http://www.rodoslovlje.com/rodoslov/\">My Rodoslov</a></li>"
    ."<li><a href=\"http://www.rodoslovlje.com/slike/\">Gallery</a></li>"
    ."<li><a href=\"http://www.rodoslovlje.com/links/\">Links</a></li>"
    ."<li><a href=\"http://www.rodoslovlje.com/amember/signup.php\">SGS Membership</a></li>"
    ."<li><a href=\"http://www.rodoslovlje.com/contact/\">Contact</a></li>"
    ."<li><a href=\"http://www.rodoslovlje.com/sgsmembers\">SGS Members section</a><img src=\"http://www.rodoslovlje.com/images/premium.gif\" alt=\"\" ></li>"
    ."<li><a href=\"http://www.rodoslovlje.com/amember/member.php\">Your Account</a></li>"
    ."</ul>"
    ."<h2>Navigacija</h2>"
    ."<ul class=\"nav\">"
    ."<li><a href=\"http://www.rodoslovlje.com/sgsmembers\">SRD Clanovi</a><img src=\"http://www.rodoslovlje.com/images/premium.gif\" alt=\"\">"
    ."<li><a href=\"http://www.rodoslovlje.com/amember/member.php\">Vaš nalog</a></li>"
    ."</ul>";
    }else {print 
    "<form method=\"post\" action='/amember/login.php'> Username:<br/> <input type=\"text\" name=\"amember_login\" size=\"10\" /> <br/> Password:<br/> <input type=\"password\" name=\"amember_pass\" size=\"10\" /> <br/> <input type=\"submit\" value='Login'/> </form>";}?>
    Try and space your code out a little bit more so that it's easier to spot little errors like that.
    OMFG SitePoint ROXORZ TEH BIG ONE111!
    Wish you were invisible?

  5. #5
    SitePoint Addict Hajduk's Avatar
    Join Date
    Nov 2004
    Location
    Behind you
    Posts
    357
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thnx all :-)

  6. #6
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    to save echoing all that and escaping thousands of "s, simply drop out of php, print normally the parts you nee and then go back into php.

    Makes life alot easier!

    Just a tip

    Spike
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  7. #7
    Wadge! F4nat1c's Avatar
    Join Date
    Oct 2005
    Location
    South Wales, UK
    Posts
    1,134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by spikeZ
    to save echoing all that and escaping thousands of "s, simply drop out of php, print normally the parts you nee and then go back into php.

    Makes life alot easier!

    Just a tip

    Spike
    Or alternatively he could could use heredoc code.
    OMFG SitePoint ROXORZ TEH BIG ONE111!
    Wish you were invisible?

  8. #8
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    absolutely

    either way is a heck of a lot easier than debugging hooooooge echo's!
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....


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
  •