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();
?> 

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";

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();
?> 

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!!!!

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.