Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Parse error on non-existant line

NeakNeak Posts: 87Member
I get this error:
Parse error: parse error in /home/exirptco/public_html/main/vis_mod.php on line 135
on one of my scripts...

The problem is, the script only has 134 lines.
I found a similar case on this board, but it was too old to view the solution.

Comments

  • DarQDarQ Posts: 1,625Member
    [red]
    the bug is with errors like these ALWAYS below the line php gives you an error on. you obviously forgot a " ' ; { }
    [/red]

    : I get this error:
    : Parse error: parse error in /home/exirptco/public_html/main/vis_mod.php on line 135
    : on one of my scripts...
    :
    : The problem is, the script only has 134 lines.
    : I found a similar case on this board, but it was too old to view the solution.
    :

    [size=5][italic][blue]Dar[RED]Q[/RED][/blue][/italic][/size]
    url--> http://mark.space.servehttp.com

  • NeakNeak Posts: 87Member
    : [red]
    : the bug is with errors like these ALWAYS below the line php gives you an error on. you obviously forgot a " ' ; { }
    : [/red]

    Eh... The line above where that line would be simply says:
    [code]?>[/code]
    I was wondering, though... In PHP you can have else if() statements, right? like:
    [code]
    if (this){}
    else if (this){}
    [/code]
  • DarQDarQ Posts: 1,625Member
    : : [red]
    : : the bug is with errors like these ALWAYS below the line php gives you an error on. you obviously forgot a " ' ; { }
    : : [/red]
    :
    : Eh... The line above where that line would be simply says:
    : [code]?>[/code]
    : I was wondering, though... In PHP you can have else if() statements, right? like:
    : [code]
    : if (this){}
    : else if (this){}
    : [/code]
    [red]
    yes
    [/red]
    :

    [size=5][italic][blue]Dar[RED]Q[/RED][/blue][/italic][/size]
    url--> http://mark.space.servehttp.com

  • NeakNeak Posts: 87Member
    : : I was wondering, though... In PHP you can have else if() statements, right? like:
    : : [code]
    : : if (this){}
    : : else if (this){}
    : : [/code]
    : [red]
    : yes
    : [/red]

    Well, that was my last guess as to why it is giving me that error. Heh... that sucks.
  • KylixenKylixen Posts: 14Member
    : : : I was wondering, though... In PHP you can have else if() statements, right? like:
    : : : [code]
    : : : if (this){}
    : : : else if (this){}
    : : : [/code]
    : : [red]
    : : yes
    : : [/red]
    :
    : Well, that was my last guess as to why it is giving me that error. Heh... that sucks.
    :

    Post the code, I have a feeling you are going to feel rather silly when you realize what the problem is.

    -- Kylixen
  • NeakNeak Posts: 87Member
    : Post the code, I have a feeling you are going to feel rather silly when you realize what the problem is.
    :
    : -- Kylixen
    I have the same feeling, but the code is really long... Here it is, though.
    [code]
    <?php
    session_start();
    $handle = $_SESSION['handle'];
    $date = $_SESSION['datage']; # date comes from the session superglobal
    $title = $_POST['title']; # title comes from the form
    $comment = $_POST['comment']; # comment comes from the form
    $path = $_POST['path']; # path comes from the form
    $oldID = $_POST['oldID']; # GET THE FRIGGIN ID!!1111111111111
    $delete = $_POST['delete']; # Get the delete checkbox's value, yeah!
    $submit = $_POST['submit'];

    # Require the friggin' database connection script!
    require "../connect.php";

    # If they chose to delete...
    if ($delete)
    {
    $delquery = 'DELETE FROM `visual_'. $cat .'` WHERE `id` = "'. $oldID .'"';
    $delresult = mysql_query($delquery, $connection);
    # Echo stuff...
    echo '<html>';
    echo 'I hope it worked... :D';
    }
    # If not... Show 'em the part they chose!
    else if ($listed)
    {
    $listed_results = mysql_query('SELECT * FROM `visual_'. $cat .'` WHERE id= ''. $listed .'' ORDER BY `id` DESC');
    while($arrayage = mysql_fetch_array($listed_results))
    {
    echo '';
    echo '';
    echo '';
    echo "";
    echo "";
    echo "";
    echo "";
    echo "";
    echo "";
    echo '
    Handle:";
    echo ''. $arrayage[handle] .'';
    echo "
    Date:";
    echo ''. $arrayage[date] .'';
    echo "
    Title:";
    echo ''. $arrayage[title] .'';
    echo "
    Comment:";
    echo ''. $arrayage[comment] .'';
    echo "
    Path [ Don't modify this... unless you're a moron. ]:";
    echo ''. $arrayage[path] .'';
    echo "
    Category:";
    echo 'The category can not be changed.';
    echo "
    ';
    echo "";
    echo '


    ';
    }
    }
    # If not, query this madness into the DB...
    else if ($submit)
    {
    $query = 'UPDATE `visual_'. $cat .'` SET `path` = "'. $path .'", `title` = "'. $title.'", `handle` = "'. $handle.'", `comment` = "'. $comment.'", `date` = "'. $date.'" WHERE `id` = "'. $oldID .'"';
    $result = mysql_query($query, $connection);
    # Echo stuff...
    echo '';
    echo 'I hope it worked... :D';
    }
    # If none of those, give them the main part...
    else
    {
    if ($handle)
    {
    # Top of the page
    echo '

    function pop(url, name, features)
    {
    newwindow = window.open(url, name, features);
    newwindow.focus();
    }

    ';

    # Queriage.
    $neak_results = mysql_query('SELECT * FROM `visual_'. $cat .'` WHERE handle='neak' ORDER BY `id` DESC');
    $rendaw_results = mysql_query('SELECT * FROM `visual_'. $cat .'` WHERE handle='rendaw' ORDER BY `id` DESC');

    # List the pictures
    echo '




    :: Neak
    :: Rendaw
    ';

    while($arrayage = mysql_fetch_array($neak_results))
    {
    $imagesize = getimagesize($arrayage[path]);
    $tempwidth = $imagesize[0];
    $tempheight = $imagesize[1];
    if($tempwidth > 750)
    {
    $tempwidth = 750;
    }
    if($tempheight > 550)
    {
    $tempheight = 550;
    }
    # Post info.
    echo 'Thumbnail [ click for image ]:';
    echo '['. $arrayage[title] .']&nbsp&nbsp';
    echo '
    ';
    }
    echo '
    ';

    # While loop.
    while($arrayage = mysql_fetch_array($rendaw_results))
    {
    $imagesize = getimagesize($arrayage[path]);
    $tempwidth = $imagesize[0];
    $tempheight = $imagesize[1];
    if($tempwidth > 550)
    {
    $tempwidth = 550;
    }
    if($tempheight > 750)
    {
    $tempheight = 750;
    }
    # Post info.
    echo 'Thumbnail [ click for image ]:';
    echo '['. $arrayage[title] .']&nbsp&nbsp';
    echo '
    ';
    }
    }
    mysql_close();
    ?>
    [/code]
    If you want to know, it's for modifying entries to a database for an image gallery I'm working on.
  • NeakNeak Posts: 87Member
    : : Post the code, I have a feeling you are going to feel rather silly when you realize what the problem is.
    : :
    : : -- Kylixen
    : I have the same feeling, but the code is really long... Here it is, though.

    ROFL! Well, I do feel pretty silly. Immediately after posting the code I noticed the lack of one } at the end, before mysql_close()... But the good news is that it works now! Whoopee! Thanks for all the awesome help on this message board, I don't know what I'd do without it! :D

  • JonathanJonathan Posts: 2,914Member
    : : : Post the code, I have a feeling you are going to feel rather silly when you realize what the problem is.
    : : :
    : : : -- Kylixen
    : : I have the same feeling, but the code is really long... Here it is, though.
    :
    : ROFL! Well, I do feel pretty silly. Immediately after posting the code I noticed the lack of one } at the end, before mysql_close()... But the good news is that it works now! Whoopee! Thanks for all the awesome help on this message board, I don't know what I'd do without it! :D
    :
    Little tip, take it or leave it. When I'm coding I will tend to put in the opening brace and the closing brace, like:-

    if (something) {
    }

    Then I'll put the stuff in between them. Helps avoid missing them later. :-)

    Easy way to check if one's missing at UNIX/Linux shell:-

    cat yourscript.php | grep { | wc -l
    cat yourscript.php | grep } | wc -l

    If you get different numbers there may be something missing.

    Don't feel silly, everyone does this once in a while. It's about as classic as forgetting a ; on the end of a line.

    Jonathan

    ###
    for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");

  • KylixenKylixen Posts: 14Member
    : : : : Post the code, I have a feeling you are going to feel rather silly when you realize what the problem is.
    : : : :
    : : : : -- Kylixen
    : : : I have the same feeling, but the code is really long... Here it is, though.
    : :
    : : ROFL! Well, I do feel pretty silly. Immediately after posting the code I noticed the lack of one } at the end, before mysql_close()... But the good news is that it works now! Whoopee! Thanks for all the awesome help on this message board, I don't know what I'd do without it! :D
    : :
    : Little tip, take it or leave it. When I'm coding I will tend to put in the opening brace and the closing brace, like:-
    :
    : if (something) {
    : }
    :
    : Then I'll put the stuff in between them. Helps avoid missing them later. :-)
    :
    : Easy way to check if one's missing at UNIX/Linux shell:-
    :
    : cat yourscript.php | grep { | wc -l
    : cat yourscript.php | grep } | wc -l
    :
    : If you get different numbers there may be something missing.
    :
    : Don't feel silly, everyone does this once in a while. It's about as classic as forgetting a ; on the end of a line.
    :
    : Jonathan
    :
    : ###
    : for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    : (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    : /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");
    :
    :


    And on the bright side, you will pick it up immediately next time. So you won't spend more than 30 seconds thinking, uh "wtf"??

    --Kylixen
Sign In or Register to comment.