Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.87 KB | None | 0 0
  1. Here some of my work...
  2.  
  3.  
  4. Email Validation
  5.  
  6.  
  7. <?
  8. function is_valid_email($email) {
  9.     if(ereg("([[:alnum:]\.\-]+)(\@[[:alnum:]\.\-]+\.+)", $email)) {
  10.         return 1;
  11.     } else {
  12.         return 0;
  13.     }
  14. }
  15. ?>
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22. User Pass System working with MySQL
  23.  
  24.  
  25. <?
  26. /*
  27. SQL to build sample database named 'your-database-here'
  28. CREATE TABLE user-password-table (
  29.   username varchar(12),
  30.   password varchar(12),
  31. );
  32.  
  33. INSERT INTO user-password-table  VALUES ('your-username-here','your-password-here');
  34. */
  35.  
  36.  
  37. $username = "your-username-here";
  38. $password = "your-password-here";
  39. $database = "your-database-here";
  40.  
  41. $db = mysql_connect("localhost", "$username", "$password");
  42. mysql_select_db("$database",$db);
  43. $result = mysql_query("select count(username) as Total from user-password-table where username='$username' and password='$password'",$db);
  44. $row = mysql_fetch_array($result);
  45. if ($row["Total"]=="0"):
  46.         echo "<BODY bgcolor=\"#BFBFBF\" link=\"Black\" vlink=\"Black\" alink=\"Black\">";
  47.         echo "<FONT FACE=\"Arial\" COLOR=\"#FFFFFF\"> ";
  48.         echo "<CENTER><H1>WARNING:<P>USER/PASSWORD Failed!</H1></CENTER>";
  49. else:
  50.         echo "<BODY bgcolor=\"#BFBFBF\" link=\"Black\" vlink=\"Black\" alink=\"Black\">";
  51.         echo "<FONT FACE=\"Arial\" COLOR=\"#FFFFFF\"> ";
  52.         echo "<CENTER><H1>Welcome Back $username.</H1></CENTER>";
  53. endif;
  54. mysql_close($db);
  55. ?>
  56.  
  57.  
  58.  
  59.  
  60.  
  61. Open
  62.  
  63.  
  64. Open
  65.  
  66. File
  67. <?php
  68. // Save the FDF data into a temp file
  69. $fdffp = fopen("test.fdf", "w");
  70. fwrite($fdffp, $HTTP_FDF_DATA, strlen($HTTP_FDF_DATA));
  71. fclose($fdffp);
  72.  
  73. // Open temp file and evaluate data
  74. $fdf = fdf_open("test.fdf");
  75. ...
  76. fdf_close($fdf);
  77. ?>
  78.  
  79. String
  80. <?php
  81. $fdf = fdf_open_string($HTTP_FDF_DATA);
  82. ...
  83. fdf_close($fdf);
  84. ?>
  85.  
  86.  
  87.  
  88.  
  89.  
  90. I have plently more PHP coding to show you if you'd like to see more...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement