Jump to content

[SOLVED] Beta PHP Script


sawade

Recommended Posts

in the robots.txt file do you have

 

User-agent: *
Disallow: /secureforms/forms/demo/hipaaprivacy.php

User-agent: *
Disallow: secureforms/forms/demo/hipaaprivacy.php

User-agent: *
Disallow: /forms/demo/hipaaprivacy.php
User-agent: *
Disallow: forms/demo/hipaaprivacy.php

User-agent: *
Disallow:/demo/hipaaprivacy.php

User-agent: *
Disallow: demo/hipaaprivacy.php
User-agent: *
Disallow: demo/hipaaprivacy.php

User-agent: *
Disallow: hipaaprivacy.php

 

one of these is bound to work

 

 

Link to comment
Share on other sites

OKay... email input field....  lets see...      :examine:     

 

maxlength -  :thumb-up:

variable used strip_tags() -  :thumb-up:

variable passes thru validation -  :thumb-up:

 

no email addresses on page -  :thumb-up:

.htaccess protects email constants - :thumb-up:

directories password protected - :thumb-up:

 

Can't think of anything else.

Link to comment
Share on other sites


<?php

    class EmailAddressValidator {

 

        public function check_email_address($strEmailAddress) {

 

            // Control characters are not allowed

            if (preg_match('/[\x00-\x1F\x7F-\xFF]/', $strEmailAddress)) {

                return false;

            }

 

            // Check email length - min 3 (a@a), max 256

            if (!$this->check_text_length($strEmailAddress, 3, 256)) {

                return false;

            }

 

            // Split it into sections using last instance of "@"

            $intAtSymbol = strrpos($strEmailAddress, '@');

            if ($intAtSymbol === false) {

                // No "@" symbol in email.

                return false;

            }

            $arrEmailAddress[0] = substr($strEmailAddress, 0, $intAtSymbol);

            $arrEmailAddress[1] = substr($strEmailAddress, $intAtSymbol + 1);

 

            $arrTempAddress[0] = preg_replace('/\./'

                                            ,''

                                            ,$arrEmailAddress[0]);

            $arrTempAddress[0] = preg_replace('/"[^"]+"/'

                                            ,''

                                            ,$arrTempAddress[0]);

            $arrTempAddress[1] = $arrEmailAddress[1];

            $strTempAddress = $arrTempAddress[0] . $arrTempAddress[1];

            // Then check - should be no "@" symbols.

            if (strrpos($strTempAddress, '@') !== false) {

                // "@" symbol found

                return false;

            }

 

            // Check local portion

            if (!$this->check_local_portion($arrEmailAddress[0])) {

                return false;

            }

 

            // Check domain portion

            if (!$this->check_domain_portion($arrEmailAddress[1])) {

                return false;

            }

 

            // If we're still here, all checks above passed. Email is valid.

            return true;

 

        }

 

        protected function check_local_portion($strLocalPortion) {

 

            if (!$this->check_text_length($strLocalPortion, 1, 64)) {

                return false;

            }

 

            $arrLocalPortion = explode('.', $strLocalPortion);

            for ($i = 0, $max = sizeof($arrLocalPortion); $i < $max; $i++) {

                if (!preg_match('.^('

                                .    '([A-Za-z0-9!#$%&\'*+/=?^_`{|}~-]'

                                .    '[A-Za-z0-9!#$%&\'*+/=?^_`{|}~-]{0,63})'

                                .'|'

                                .    '("[^\\\"]{0,62}")'

                                .')$.'

                                ,$arrLocalPortion[$i])) {

                    return false;

                }

            }

            return true;

        }

 

        protected function check_domain_portion($strDomainPortion) {

            // Total domain can only be from 1 to 255 characters, inclusive

            if (!$this->check_text_length($strDomainPortion, 1, 255)) {

                return false;

            }

            // Check if domain is IP, possibly enclosed in square brackets.

            if (preg_match('/^(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])'

              .'(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}$/'

              ,$strDomainPortion) ||

                preg_match('/^\[(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])'

              .'(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}\]$/'

              ,$strDomainPortion)) {

                return true;

            } else {

                $arrDomainPortion = explode('.', $strDomainPortion);

                if (sizeof($arrDomainPortion) < 2) {

                    return false; // Not enough parts to domain

                }

                for ($i = 0, $max = sizeof($arrDomainPortion); $i < $max; $i++) {

                    // Each portion must be between 1 and 63 characters, inclusive

                    if (!$this->check_text_length($arrDomainPortion[$i], 1, 63)) {

                        return false;

                    }

                    if (!preg_match('/^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|'

                      .'([A-Za-z0-9]+))$/', $arrDomainPortion[$i])) {

                        return false;

                    }

                    if ($i == $max - 1) { // TLD cannot be only numbers

                        if (strlen(preg_replace('/[0-9]/', '', $arrDomainPortion[$i])) <= 0) {

                            return false;

                        }

                    }

                }

            }

            return true;

        }

 

        protected function check_text_length($strText, $intMinimum, $intMaximum) {

            // Minimum and maximum are both inclusive

            $intTextLength = strlen($strText);

            if (($intTextLength < $intMinimum) || ($intTextLength > $intMaximum)) {

                return false;

            } else {

                return true;

            }

        }

 

    }

 

?>

Link to comment
Share on other sites

Grr darn it...

 

<?php
    class EmailAddressValidator {

        public function check_email_address($strEmailAddress) {

            // Control characters are not allowed
            if (preg_match('/[\x00-\x1F\x7F-\xFF]/', $strEmailAddress)) {
                return false;
            }

            // Check email length - min 3 (a@a), max 256
            if (!$this->check_text_length($strEmailAddress, 3, 256)) {
                return false;
            }

            // Split it into sections using last instance of "@"
            $intAtSymbol = strrpos($strEmailAddress, '@');
            if ($intAtSymbol === false) {
                // No "@" symbol in email.
                return false;
            }
            $arrEmailAddress[0] = substr($strEmailAddress, 0, $intAtSymbol);
            $arrEmailAddress[1] = substr($strEmailAddress, $intAtSymbol + 1);

            $arrTempAddress[0] = preg_replace('/\./'
                                             ,''
                                             ,$arrEmailAddress[0]);
            $arrTempAddress[0] = preg_replace('/"[^"]+"/'
                                             ,''
                                             ,$arrTempAddress[0]);
            $arrTempAddress[1] = $arrEmailAddress[1];
            $strTempAddress = $arrTempAddress[0] . $arrTempAddress[1];
            // Then check - should be no "@" symbols.
            if (strrpos($strTempAddress, '@') !== false) {
                // "@" symbol found
                return false;
            }

            // Check local portion
            if (!$this->check_local_portion($arrEmailAddress[0])) {
                return false;
            }

            // Check domain portion
            if (!$this->check_domain_portion($arrEmailAddress[1])) {
                return false;
            }

            // If we're still here, all checks above passed. Email is valid.
            return true;

        }

        protected function check_local_portion($strLocalPortion) {

            if (!$this->check_text_length($strLocalPortion, 1, 64)) {
                return false;
            }

            $arrLocalPortion = explode('.', $strLocalPortion);
            for ($i = 0, $max = sizeof($arrLocalPortion); $i < $max; $i++) {
                 if (!preg_match('.^('
                                .    '([A-Za-z0-9!#$%&\'*+/=?^_`{|}~-]' 
                                .    '[A-Za-z0-9!#$%&\'*+/=?^_`{|}~-]{0,63})'
                                .'|'
                                .    '("[^\\\"]{0,62}")'
                                .')$.'
                                ,$arrLocalPortion[$i])) {
                    return false;
                }
            }
            return true;
        }

        protected function check_domain_portion($strDomainPortion) {
            // Total domain can only be from 1 to 255 characters, inclusive
            if (!$this->check_text_length($strDomainPortion, 1, 255)) {
                return false;
            }
            // Check if domain is IP, possibly enclosed in square brackets.
            if (preg_match('/^(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])'
               .'(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}$/'
               ,$strDomainPortion) || 
                preg_match('/^\[(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])'
               .'(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}\]$/'
               ,$strDomainPortion)) {
                return true;
            } else {
                $arrDomainPortion = explode('.', $strDomainPortion);
                if (sizeof($arrDomainPortion) < 2) {
                    return false; // Not enough parts to domain
                }
                for ($i = 0, $max = sizeof($arrDomainPortion); $i < $max; $i++) {
                    // Each portion must be between 1 and 63 characters, inclusive
                    if (!$this->check_text_length($arrDomainPortion[$i], 1, 63)) {
                        return false;
                    }
                    if (!preg_match('/^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|'
                       .'([A-Za-z0-9]+))$/', $arrDomainPortion[$i])) {
                        return false;
                    }
                    if ($i == $max - 1) { // TLD cannot be only numbers
                        if (strlen(preg_replace('/[0-9]/', '', $arrDomainPortion[$i])) <= 0) {
                            return false;
                        }
                    }
                }
            }
            return true;
        }

        protected function check_text_length($strText, $intMinimum, $intMaximum) {
            // Minimum and maximum are both inclusive
            $intTextLength = strlen($strText);
            if (($intTextLength < $intMinimum) || ($intTextLength > $intMaximum)) {
                return false;
            } else {
                return true;
            }
        }

    }

?>

Link to comment
Share on other sites

i got this from phpclasses

 

anti spambot class:

<?php
/**
+-------------------------------------------------------------------------
+---------------------->> In The Name Of Allah <<-------------------------
+-------------------------------------------------------------------------
| Class AntiIFLSpamBotEmail version 0.0.1  (for php 5++)
| Security Email Print 100% Protected For Spam Bot
| Anti Span Bot Email by ASCII
| Author  Behrouz Pooladrag  (IFLashLord) <Me [at] IFLashLord [dot] Com>
| Email bugs/suggestions to  Me [at] iflashlord.com
| Copyright (c) 2008 By Behrouz Pooladrag ,IFLashLord Co.
+-------------------------------------------------------------------------
| This script has been created and released under
| the GNU GPL and is free to use and redistribute
| only if this copyright statement is not removed
+-------------------------------------------------------------------------
+--------------| Contact 2 Behrouz Pooladrag |----------------------------
| Email : Me [ at ] IFLashLord [dot] Com
| WebSite : http://www.IFLashLord.Com
| Yahoo : BehrouzPC [at] yahoo.Com
| G-Mail : FLashLordX [at] gmail.Com
| Mobile : +98 913 12 777 14
+-------------------------------------------------------------------------
| (Zakate Elame Nasher Aan Ast )
+-------------------------------------------------------------------------
**/
/*
+--------------| arguments |----------------------------------------------
|*new AntiIFLSpamBotEmail (string [Email Address for AntiSpam]);
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|*AntiIFLSpamBotEmail->antispambot([integer Number]);
| Number 0  ---> For Show Email text Print
| Number 1  ---> For Set Email to Link (mailto:..)
| Number 2  ---> Return Randomly Part Of Eamil in Hexadecimal
+-------------------------------------------------------------------------
*/



/* Full Exampel of This Class

$antiSpambotBehrouzpc=new AntiIFLSpamBotEmail("behrouzpc@yahoo.com"); //start class
$EmailForShow=$antiSpambotBehrouzpc->antispambot(0);  // for show mode return
$EmailForLink=$antiSpambotBehrouzpc->antispambot(1);  // for link mode return
print "<a href='mailto:".$EmailForLink."'>".$EmailForShow."</a>"; //and Print

*/

/* Result is this Type

<a href='mailto:&#98;&#101;h&#114;%6f%75zpc&#64;y&#97;%68o&#111;%2e&#99;%6f%6d'>
&#98;eh&#114;&#111;&#117;&#122;pc&#64;&#121;aho&#111;.&#99;om</a>

*/

/////////////////////////////////////////////////////


//Start Class
class AntiIFLSpamBotEmail {

const VERSION = '0.0.1';
public $emailaddy;

//construct
function __construct ($emailaddy) {
   $this->emailaddy=$emailaddy;
}//end function construct

//function to add leading zeros when necessary
public function zeroise($number,$threshold) {
	return sprintf('%0'.$threshold.'s', $number);
}//end function

    //function to change words To ASCII Random
public function antispambot($mailto=0) {
	$emailNOSPAMaddy = '';
	srand ((float) microtime() * 1000000);
	for ($i = 0; $i < strlen($this->emailaddy); $i = $i + 1) {
		$j = floor(rand(0, 1+$mailto));
		if ($j==0) {
			$emailNOSPAMaddy .= '&#'.ord(substr($this->emailaddy,$i,1)).';';
		} elseif ($j==1) {
			$emailNOSPAMaddy .= substr($this->emailaddy,$i,1);
		} elseif ($j==2) {
			$emailNOSPAMaddy .= '%'.$this->zeroise(dechex(ord(substr($this->emailaddy, $i, 1))), 2);
		}
	}
	$emailNOSPAMaddy = str_replace('@','&#64;',$emailNOSPAMaddy);
	return $emailNOSPAMaddy;
}//end function

}//end Class

?>

example:

 

<?php
    include_once("antiSpamEmail-IFLashLord-php5.php");
    //include_once("antiSpamEmail-IFLashLord-php4.php");
    //Start Example
    $antiSpambotBehrouzpc=new AntiIFLSpamBotEmail("behrouzpc@yahoo.com"); //start class
    $EmailForShow=$antiSpambotBehrouzpc->antispambot(0);  // for show mode return
    $EmailForLink=$antiSpambotBehrouzpc->antispambot(1);  // for link mode return
    print "<a href='mailto:".$EmailForLink."'>".$EmailForShow."</a>"; //and Print

?>

Link to comment
Share on other sites

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