Advertisement
alboorii

Untitled

Feb 23rd, 2020
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.41 KB | None | 0 0
  1. <?php
  2. require_once('path/to/connection/file.php');
  3.  
  4. $name = mysql_real_escape_string($_POST['name']);
  5. $mail = mysql_real_escape_string($_POST['mail']);
  6.  
  7. $res = mysql_query("SELECT `mail` FROM `all` WHERE `mail` = '$mail'");
  8.  
  9. if(mysql_num_rows($res) > 0){
  10.     echo 'هذا البريد مستعمل مسبقا !';
  11. }else{
  12.     mysql_query("INSERT INTO `all`(`id`, `name`, `mail`)VALUES (NULL, '$name', '$mail')");
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement