PHP submit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, i have the next problem, i have 2 forms, one where i only show 
the textfields and the other where i submit the information, i want 
in my submit form return me a error value to my first page .
THE REQUEST METHOD IS NOT WORKING PROPERLY
Here is the code,PLEASE HELP
FORM2.PHP
<form name="requestfree" method="post" action="/formS2.php">
     <?
	 	
	 	if ($_REQUEST["resp"] = 'incorrect-captcha-sol')
		{
		echo('Incorrect Verification');
		}
	 ?>

		<table border="0" cellspacing="0" cellpadding="4">

          	<tr>
          	  <td align="right" nowrap></td>
          	  <td><input type="hidden" name="hid"></td>
        	  </tr>
          	<tr>
          		<td align="right" nowrap>* First Name </td>
          		<td><input type="text" name="FirstName" 
id="FirstName" class="myinp"></td>
         		</tr>
          	<tr>
          		<td align="right" nowrap>* Last Name </td>
          		<td><input name="LastName" id="LastName" 
type="text" class="myinp"></td>
         		</tr>
          	          	<tr>
          		<td align="right" nowrap>Customer Login email 
address<br>(<i>Existing customers only</i>)</td>
          		<td><input type="text" 
name="CustomerLoginEmail" id="CustomerLoginEmail" class="myinp" 
onblur="CustomerLoginEmail_onblur();"></td>
         	</tr>
          	          	<tr>
            		          	
          					
          		

    <br/>

          		<tr>
          		  <td colspan="2" align="center"><?php
				 
				  
require_once('recaptchalib.php');

// Get a key from http://recaptcha.net/api/getkey
$publickey = "6LdXwgAAAAAAABI2lfSWYknFgW1zDGneKrtkV1LM ";
$privatekey = "6LdXwgAAAAAAAAapDSozUmMc4rKTz0TeRSYdIFb- ";


echo recaptcha_get_html($publickey, $error);
?></td>
       		    </tr>
          		<td colspan="2" align="center"><input 
type="submit" name="Submit" value="Send Form"></td>
         		</tr>
          	</table>
        
       </form>

HERE IS THE SUBMIT FORM
FORMS2.PHP
<?php
session_start();

require_once('recaptchalib.php');

// Get a key from http://recaptcha.net/api/getkey
$publickey = "6LdXwgAAAAAAABI2lfSWYknFgW1zDGneKrtkV1LM ";
$privatekey = "6LdXwgAAAAAAAAapDSozUmMc4rKTz0TeRSYdIFb- ";

//$_SESSION['resp'] = 'whatever';
//$_SESSION['error'] = $whatever;

# the response from reCAPTCHA
global $resp ;
# the error code from reCAPTCHA, if any
global $error;

# was there a reCAPTCHA response?
if ($_REQUEST["recaptcha_response_field"]) {
        $resp = recaptcha_check_answer ($privatekey,
                                        $_SERVER["REMOTE_ADDR"],
                                        $_REQUEST
["recaptcha_challenge_field"],
                                        $_REQUEST
["recaptcha_response_field"]);

        if ($resp->is_valid)  {
              // echo "You got it!";
			   header("Location: formS2.php");
        } else {
                # set the error code so that we can display it
               //if not ($resp ->is_valid){
			    $error = $resp->error;
				header("Location: form2.php?resp=
{$error}");
				//header ("Location: form2.php");
				
				echo recaptcha_get_html($publickey, 
$error);
				
				exit();
				//die ("The reCAPTCHA wasn't entered 
correctly. Go back and try itagain." . "(reCAPTCHA said: " . $resp-
>error . ")"); 
        }
}
i WANT TO RETRIEVE THE ERROR value TO FORM2.PHP


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux