SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2004
    Location
    Iceland
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    unexpected T_STRING // SOLVED

    I was just trying to validate my site via the W3C validator. Seeing as this is my first site, I had a BUNCH of errors come up. Anyways, I was trying to fix that. Requiring me to close some unclosed meta tags, adding ; after &nbsps and some unimportant stuff. The last thing I remember doing was replacing & in links with & and then, suddenly I get this error...
    Code:
    Parse error: parse error, unexpected T_STRING in /www/scripts/comicsys.php on line 41
    Line 41 is the line where I am inserting stuff into the $queryarg variable:
    PHP Code:
    function displayrants($comicid) {
            global 
    $db;

            
    $queryarg "SELECT id, author, mood, title, rant, DATE_FORMAT(postdate, '%M %D, %Y - %H:%m:%S') AS date FROM rants WHERE comicid=001 ORDER BY postdate DESC";
            
    $query mysql_query($queryarg);
            while(
    $row mysql_fetch_assoc($query)) {
                    
    $title htmlentities($row['title']);
                    
    $rant 
    l2br(htmlentities($row['rant']));
    ...[/PHP]

    Can you spot anything that could be the cause of the above error? Because I can't... And what's more is that I didn't change anything close to these lines.

    So what's wrong? Do you think that the adding of ;s could have ****ed up my code? I tested a 'echo "asdasd;asdfasdf";' statement, and it worked...

    Here are my scripts if you have some time to spend, and would like to use it trying to help me.

    http://itami.ath.cx/index.phps
    http://itami.ath.cx/scripts/rantsys.phps
    http://itami.ath.cx/scripts/comicsys.phps

    And if you're even newer than me to php, you're free to copy the code and do what ever you wish with it.

    Anyways, if you have some comments on this problem of mine, please help. I'm totally lost.

  2. #2
    Tranceoholic lilleman's Avatar
    Join Date
    Feb 2004
    Location
    Írebro, Sweden
    Posts
    2,716
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    After taking a quick look at comicsys.phps, it seems like you have forgotten to close the function called displaycomic.

    Yours, Erik.

  3. #3
    SitePoint Enthusiast
    Join Date
    Nov 2004
    Location
    Boston
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi

    lilleman right, I should have looked at your script before writing what I wrote,


    J!

  4. #4
    SitePoint Enthusiast
    Join Date
    Sep 2004
    Location
    Iceland
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm, you're right...

    And actually... my WHOLE rantsys.php file is there... in my comicsys.php file, in between my function and my closing tag. WTF?

    I've probably hit some wrong keys, and read the the rantsys.php into the file, but it's PRETTY DAMN HARD to do that by accident. (Using the editor Nano.)

    Thanks for the quick replies, I was looking at all the wrong places. Searching for the &s, and  s and trying to see if the could be causing some trouble. Because I THOUGHT that was pretty much all I changed.

    Anyways, thanks. It would have taken me a pretty long time to figure that out by myself. ^^


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
  •