preg_match
Tenho um script para me enviar o email cadastrado em php por preg_match.
Mais a Arroba @ e o que vem escrito antes, fica invisível, O que esta escrito na frente aparece, tipo gmail.com
Como poderia arrumar isso para aparecer o email completo no registro online.
/applications/core/interface/imageproxy/imageproxy.php?img=http://nfx.comuv.com/unnamed.png&key=456b34cc36adecc357b570c2dd32272e43355c94f16aa723a4ac6638084a5110" alt="unnamed.png" />
Aqui esta o script.
<?php
function Connect(){
//Set global variables so they can be used in this function
global $hostName; global $userName;
global $password; global $database;
$status = mysql_connect($hostName,$userName,$password); //Attempt to connect to Database
if(!$status){echo 'Server Not Found'; exit;} //Hosting Server not found
if(!@mysql_select_db($database)){echo 'Database Not Found'; exit;} //Database not found
return $status; //Return link on established connection
}
function CheckKey($hash,$name){ //Check weather Md5 hash matches
global $secretKey;
$checkHash = md5($name.$secretKey);
if(strcmp($checkHash,$hash) == 0){
return 'pass'; //hash matches
}else{
return 'fail'; //hash failed
}
}
function CleanInput($input){ //Sanitize user input
$cleanInput = mysql_real_escape_string($input); //Use string escape
if(preg_match('/[^@.a-z_\-0-9\s]/i',$cleanInput) == 1){ // Using regular expression
echo 'Bad Input ==> ' . $input; exit; //Failed, exit to prevemt sql injection hacks
}
return $cleanInput; //Return clean input
}
?>Discussão (12)
Carregando comentários...