Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $DB_HOST="localhost";
- $DB_USER="root";
- $DB_PASSWORD="";
- $DB_NAME="company";
- $con=mysql_connect($DB_HOST,$DB_USER,$DB_PASSWORD) or die("Failed to connect to MySQL: " . mysql_error());
- $db=mysql_select_db($DB_NAME,$con) or die("Failed to connect to MySQL: " . mysql_error());
- if(isset($_POST['submit'])){
- $firstname = $_POST['firstname'];
- $lastname = $_POST['lastname'];
- $gender = $_POST['gender'];
- $email = $_POST['email'];
- $password = $_POST['password'];
- $rpassword = $_POST['rpassword'];
- $mobile = $_POST['mobile'];
- $film = $_POST['film'];
- $tv= $_POST['tv'];
- $radio= $_POST['radio'];
- $experience= $_POST['experience'];
- $file = rand(1000,100000)."-".$_FILES['aphoto']['name'];
- $file_loc = $_FILES['aphoto']['tmp_name'];
- $file_size = $_FILES['aphoto']['size'];
- $file_type = $_FILES['aphoto']['type'];
- $folder="uploads/";
- move_uploaded_file($file_loc,$folder.$file);
- //Insert Query of SQL
- $query = mysql_query("INSERT INTO `tav` (Firstname,Lastname,Gender,email_1,password_1,rpassword_1,mobile_1,film_1,tv_1,radio,explevel,file,type,size) VALUES ('".$firstname."','".$lastname."', '".$gender."','".$email."', '".$password."','".$rpassword."', '".$mobile."','".$film."','".$tv."','".$radio."','".$experience."','".$file."','".$file_type."','".$file_size."')");
- echo "<br/><br/><span>Data Inserted successfully...!!</span>";
- }
- mysql_close($con); // Closing Connection with Server
- ?>
Add Comment
Please, Sign In to add comment