<?php ob_start(); //Getting Information From The Registar Page $conn=mysql_connect("localhost","akoka","6584340") or die(mysql_error()); mysql_select_db("portal") or die(mysql_error()); $username=strtolower(addslashes($_POST)); $password=strtolower(addslashes($_POST)); $firstname=addslashes($_POST); $lastname=addslashes($_POST); $age=addslashes($_REQUEST); $notes=addslashes($_POST); $email=addslashes($_REQUEST); $emailsplit=explode("@",$email); $getarr=array($emailsplit); $list=array( $list="walla.co.il", $list="zahav.net.il", $list="msn.co.il" ); //Email Checking if ($emailsplit == $list or $emailsplit == $list or $emailsplit == $list) { }else{ ?> <script> alert("email is bad"); window.location="registar.php"; </script> <? mysql_close(); } //Empty Feilds Checking if ($username == "" or $firstname == "" or $lastname == "" or $age == "" or $notes == "" or $email == "") { ?> <script> window.location="registar.php"; </script> <? $query=mysql_query("SELECT from users (username,email) VALUES ('$username','$email')"); $fetch=mysql_fetch_array($query); //Dupliaction Chacking if ($username == $fetch or $email == $fetch) { echo "email or username are exits"; mysql_close(); } else { //Insert Users Into DataBase mysql_query("INSERT INTO users (username,password,firstname,lastname,age,notes,email) VALUES ('$username','$password','$firstname','$lastname','$age','$notes','$email')") or die(mysql_error()); header("location: registar.php"); } ?>
|