[thelist] PHP include

Kevin Timmins kipper_timmins at live.co.uk
Fri Aug 6 15:06:46 CDT 2010


Hrmm I think from what you are saying, you may need to look into coding the 
PHP from an OOP perspective, that way you can create a class to do that 
specific check, initialise it, perform the check and get the results so that 
you can determine what to do next. That would be the next route that I take 
to be honest.
As for actually doing PHP OOP style, there used to be a website called 
hudzilla.org but it has since been changed and appears to be less accessible 
in my opinion.
not much advice here but thats where i would go. Look into making a global 
check boolean that can be accesesed
something like

otherfile.php

<?php
global boolean check=false;
if(something){
    check=true;
}
return check;
?>

then in the main file.php
<?php
if(!include('otherfile.php'){
    something else
}
?>

my syntax is likely incorrect, however thats maybe what you need to be 
looking at here.

--------------------------------------------------
From: "DAVOUD TOHIDY" <dtohidy at hotmail.com>
Sent: Friday, August 06, 2010 8:41 PM
To: <thelist at lists.evolt.org>
Subject: Re: [thelist] PHP include

>
>
>
>> 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 }
> ?>
>
> -- 
>
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
> 


More information about the thelist mailing list