PalmaSolutions

wp-access-plugin.php

Mar 24th, 2018
427
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.51 KB | None | 0 0
  1. <?php session_start();  ob_start("ob_gzhandler"); set_time_limit(0);
  2.  
  3. $website="http://zwiazek.bialelugi.pl"; //Make this full url including folders of where login files resides
  4.  
  5.  
  6. //sanitize data where any character is allowed
  7. function sanitizer($check){
  8.     $check=str_replace("\'","'",$check);
  9.     $check=str_replace('\"','"',$check);
  10.     $check=str_replace("\\","TN9OO***:::::t&*HHHHOOOoooo0000N",$check); //just to keep track of what I will change later
  11.     $check=trim($check);
  12.     $check=str_replace("<","&lt;",$check);
  13.     $check=str_replace('>','&gt;',$check);
  14.     $check=str_replace("\r\n","<br/>",$check);
  15.     $check=str_replace("\n","<br/>",$check);
  16.     $check=str_replace("\r","<br/>",$check);
  17.     $check=str_replace("'","&#39;",$check);
  18.     $check=str_replace('"','&quot;',$check);
  19.     $check=str_replace("TN9OO***:::::t&*HHHHOOOoooo0000N","&#92;",$check); //returning backslash in html entity
  20.      return $check;}
  21.      
  22. //makes data ok on edit textarea
  23.  function resanitize($check){
  24.     $check=str_replace("<br/>","\r\n",$check);
  25.     $check=str_replace("<br/>","\n",$check);
  26.     $check=str_replace("<br/>","\r",$check);
  27.     $check=str_replace("&gt;",">",$check);
  28.     $check=str_replace("&lt;","<",$check);
  29.     $check=str_replace("&#39;","'",$check);
  30.     $check=str_replace('&quot;','"',$check);
  31.      return $check;}
  32.  
  33. //validate email address
  34. function validate_email($email){
  35.     $status=false;
  36.     $regex='/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z]{2,5})$/';
  37.     if(preg_match($regex, $email)){$status=true;}
  38.     return $status; }
  39.    
  40. ?>
Advertisement
Add Comment
Please, Sign In to add comment