[thelist] PHP include

DAVOUD TOHIDY dtohidy at hotmail.com
Fri Aug 6 14:41:36 CDT 2010




> Date: Fri, 6 Aug 2010 13:45:41 -0500
> From: codeacula at codeacula.com
> To: thelist at lists.evolt.org
> Subject: Re: [thelist] PHP include
> 
> On Fri, Aug 6, 2010 at 1:25 PM, DAVOUD TOHIDY <dtohidy at hotmail.com> wrote:
> > yes without including it works. But I would like to have some stuff out of the original file for some reasons and
> > therefore I need to include it.
> 
> include.php
> 
> $processed = false;
> if($stuff) {
>      doStuff();
>      $processed = true;
> }
> 
> 
> otherfile.php
> 
> include("include.php");
> if(!processed) {
>      doOtherStuff();
> }
> 
> -- 
> Jack Timmons
> @_Codeacula


o.k let me bring the code here:

here I have a verify.php code as below:


<?php

$privatekey = "**********************************";
$resp = recaptcha_check_answer ($privatekey,$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);

if (!$resp->is_valid) {
// What happens when the CAPTCHA was entered incorrectly

$reCaptcha .= "The reCAPTCHA wasn't entered correctly. Please try it again.";

} ?>

Now I have mycontact.php file:

so the the content would be like this:

<?php
// here I need to include the verify.php content in here ( the logic is at: http://code.google.com/apis/recaptcha/docs/php.html )
else { do some validation and handle a successful verification }
?>
 		 	   		  


More information about the thelist mailing list