Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7772577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:55:13+00:00 2026-06-01T16:55:13+00:00

Okay, Im trying to set a captcha up, However with this code in, it

  • 0

Okay, Im trying to set a captcha up, However with this code in, it breaks.

if(isset($_POST["captcha"]))
    if($_SESSION["captcha"]==$_POST["captcha"])

When i do it with out it, the page works, but the captcha is letting incorrect submits through.

Parse error: syntax error, unexpected ‘”‘, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /hermes/waloraweb085/b2027/moo.lutarinet/jointest.php on line 71

<?php

$pagetitle = "Home";

$checkrank = 0;

include ($_SERVER['DOCUMENT_ROOT'].'/header.inc.php');

ECHO <<<END

<br><br>

<b><center><i><u>DO NOT</u> USE YOUR NEOPETS PASSWORD OR PIN NUMBER!!!</b></i></center>
<p>
?>


<?php session_start() ?> 
<center><P><FORM ACTION="join.pro.php" enctype="multipart/form-data" METHOD=POST>
   <table width="393" height="188" border="0" cellpadding="0" cellspacing="0">
       <td width="150">Username</td>
       <td width="243"><input type=text name="name" value="" size=32 maxlength=15></td>
     </tr>
     <tr>
       <td>Password</td>
       <td><input type=password name="pass1" VALUE="" maxlength=15></td>
     </tr>
     <tr>
       <td>Confirm Password</td>
       <td><input type=password name="pass2" VALUE="" size=32 maxlength=15></td>
     </tr>
     <tr>
       <td>Security Code (4 Diget Number)</td>
       <td><input type=password name="security" VALUE="" size=32 maxlength=4></td>
     </tr>
     <tr>
       <td>Email Address</td>
       <td><INPUT TYPE=text NAME="email" VALUE="" SIZE=32 maxlength=100></td>
     </tr>
     <tr>
       <td height="41" colspan="2" valign="middle"><p><p><center>
         By registering an account here you agree to all

         of our <A HREF="$baseurl/tos.php">Terms and

       Conditions</A>. You can also view our <A HREF="$baseurl/privacy.php">Privacy

   Policy</A>. 
       </center></p></td>
     </tr>

<tr><td align="center">CAPTCHA:<br>
    (antispam code, 3 black symbols)<br>
    <table><tr><td><img src="captcha.php" alt="captcha image"></td><td><input type="text" name="captcha" size="3" maxlength="3"></td></tr></table>
</td></tr>
<td height="27" colspan="2" valign="middle">
         <center><input type=submit name=Submit value="Register"></center>
       </td>
</table>
</form>
<?php
if(isset($_POST["captcha"]))
if($_SESSION["captcha"]==$_POST["captcha"])
{
    //CAPTHCA is valid; proceed the message: save to database, send by e-mail ...
    echo 'CAPTHCA is valid; proceed the message';
}
else
{
    echo 'CAPTHCA is not valid; ignore submission';
}
?>


<?php



END;




include ($_SERVER['DOCUMENT_ROOT'].'/footer.inc.php');


?>

captcha.php

<?php
session_start();
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); 
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); 
header("Cache-Control: no-store, no-cache, must-revalidate"); 
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); 

function _generateRandom($length=6)
{
    $_rand_src = array(
        array(48,57) //digits
        , array(97,122) //lowercase chars
//      , array(65,90) //uppercase chars
    );
    srand ((double) microtime() * 1000000);
    $random_string = "";
    for($i=0;$i<$length;$i++){
        $i1=rand(0,sizeof($_rand_src)-1);
        $random_string .= chr(rand($_rand_src[$i1][0],$_rand_src[$i1][1]));
    }
    return $random_string;
}

$im = @imagecreatefromjpeg("http://sketchedneo.com/images/sitedesigns/captcha.jpg"); 
$rand = _generateRandom(3);
$_SESSION['captcha'] = $rand;
ImageString($im, 5, 2, 2, $rand[0]." ".$rand[1]." ".$rand[2]." ", ImageColorAllocate ($im, 0, 0, 0));
$rand = _generateRandom(3);
ImageString($im, 5, 2, 2, " ".$rand[0]." ".$rand[1]." ".$rand[2], ImageColorAllocate ($im, 255, 0, 0));
Header ('Content-type: image/jpeg');
imagejpeg($im,NULL,100);
ImageDestroy($im);
?>

Help please anyone?

Line 71: if(isset($_POST[“captcha”]))

Line 72: if($_SESSION[“captcha”]==$_POST[“captcha”])

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T16:55:14+00:00Added an answer on June 1, 2026 at 4:55 pm

    EDIT:

    You’re missing END;:

    ECHO <<<END
    
    <br><br>
    
    <b><center><i><u>DO NOT</u> USE YOUR NEOPETS PASSWORD OR PIN NUMBER!!!</b></i></center><p>
    
    END; // You forgot to include this
    

    By the way, session_start() should be the first thing called in your script as it needs to be done before any other output is initiated.

    Also, try to get your braces in order with multi-line branches (makes it easier to scan):

    if (isset($_POST["captcha"]))
    {
        if ($_SESSION["captcha"] == $_POST["captcha"])
        {
            //CAPTHCA is valid; proceed the message: save to database, send by e-mail ...
            echo 'CAPTHCA is valid; proceed the message';
        }
        else
        {
            echo 'CAPTHCA is not valid; ignore submission';
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay I been trying to work this out but unable too. I have a
Okay, this has me confused once again. I am trying to either A: set
Okay, so I'm trying to set a variable via a javascript method call. However
okay, so I'm trying to set up a webpage with a div wrapping two
Okay, so I'm trying to make this bigger: Post: <input id=postbox type=text rows=6 cols=40
I'm trying to move some reusable portions of code into a class. This is
I'm trying to get my head round this (okay, tbh cramming a night before
Basically, I'm trying to integrate CruiseControl.NET with NAnt. I've got CC.NET set up, but
Okay, I think I might be over-complicating this issue but I truly am stuck.
Okay I am trying to make minecraft mods using eclipse. I used this video

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.