Jump to content

[SOLVED] Somebody please have a look I missed `','' or `';'' and I can't find it


Paldo

Recommended Posts

Hi as it's getting late I'm getting more sleepy and I just can't find what I miss somewhere...

Thanks for helping me out...

 

It say: Parse error: parse error, expecting `','' or `';'' in /3w/euweb.cz/p/parobek/captcha.php on line 6

 

<?php
ob_start();
session_start();

if(!$_POST['submit']){
    echo "<form method="post" action="captcha.php">n";
    echo "<table border="0" cellspacing="3" cellpadding="3">n";
    echo "<tr><td>Type The Letters You See Below Into the Box</td></tr>n";
    echo "<tr><td align="center"><img src="image.php"></td></tr>n";
    echo "<tr><td align="right"><input type="text" name="image"></td></tr>n";
    echo "<tr><td align="right"><input type="submit" name="submit" value="Check CAPTCHA"></td></tr>n";
    echo "</table></form>n";
}else {
    $image = $_POST['image'];
    
    if($image == $_SESSION['string']){
        echo "<b>Great success!</b>n";
    }else {
        echo "<em>Failure!</em>n";
    }
}

ob_end_flush();
?> 

Link to comment
Share on other sites

you need to escape double quotes inside a double quotes string e.g;

 

 

    echo "<form method="post" action="captcha.php">n";

 

should be

 

 

    echo "<form method=\"post\" action=\"captcha.php\">\n";

 

or even easier

 

 

    echo '<form method="post" action="captcha.php">'."\n";

Link to comment
Share on other sites

Ok so I changed it as you say but it still says the same error...

 

Parse error: parse error, expecting `','' or `';'' in /3w/euweb.cz/p/parobek/captcha.php on line 6

 

And BTW: Why it makes all the  \  disapered in whole document???

 

<?php
ob_start();
session_start();

if(!$_POST['submit']){
    echo '<form method="post" action="captcha.php">'"n";
    echo '<table border="0" cellspacing="3" cellpadding="3">' "n";
    echo '<tr><td>Type The Letters You See Below Into the Box</td></tr>'"n";
    echo '<tr><td align="center"><img src="image.php"></td></tr>' "n";
    echo '<tr><td align="right"><input type="text" name="image"></td></tr>'"n";
    echo '<tr><td align="right"><input type="submit" name="submit" value="Check CAPTCHA"></td></tr>' "n";
    echo '</table></form>'"n";
}else {
    $image = $_POST['image'];
    
    if($image == $_SESSION['string']){
        echo '<b>Great success!</b>n";
    }else {
        echo '<em>Failure!</em>n';
    }
}

ob_end_flush();
?> 

Link to comment
Share on other sites

You didn't read gevans post very well.  You missed the line.  I'll fix it for you here...

 

<?php
ob_start();
session_start();

if(!$_POST['submit']){
    echo '<form method="post" action="captcha.php">'."\n";
    echo '<table border="0" cellspacing="3" cellpadding="3">'."\n";
    echo "<tr><td>Type The Letters You See Below Into the Box</td></tr>\n";
    echo '<tr><td align="center"><img src="image.php"></td></tr>'."\n";
    echo '<tr><td align="right"><input type="text" name="image"></td></tr>'."\n";
    echo '<tr><td align="right"><input type="submit" name="submit" value="Check CAPTCHA"></td></tr>'."\n";
    echo "</table></form>\n";
}else {
    $image = $_POST['image'];
    
    if($image == $_SESSION['string']){
        echo "<b>Great success!</b>\n";
    }else {
        echo "<em>Failure!</em>\n";
    }
}

ob_end_flush();
?> 

 

THIS IS MY 500th POST ON PHP FREAKS!!!  It came quickly and I think this site is BAD ARSE!!!!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.