Guest User

phpfile

a guest
Aug 22nd, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. <?php
  2. $DB_HOST="localhost";
  3. $DB_USER="root";
  4. $DB_PASSWORD="";
  5. $DB_NAME="company";
  6. $con=mysql_connect($DB_HOST,$DB_USER,$DB_PASSWORD) or die("Failed to connect to MySQL: " . mysql_error());
  7. $db=mysql_select_db($DB_NAME,$con) or die("Failed to connect to MySQL: " . mysql_error());
  8.  
  9. if(isset($_POST['submit'])){
  10. $firstname = $_POST['firstname'];
  11. $lastname = $_POST['lastname'];
  12. $gender = $_POST['gender'];
  13. $email = $_POST['email'];
  14. $password = $_POST['password'];
  15. $rpassword = $_POST['rpassword'];
  16. $mobile = $_POST['mobile'];
  17. $film = $_POST['film'];
  18. $tv= $_POST['tv'];
  19. $radio= $_POST['radio'];
  20. $experience= $_POST['experience'];
  21. $file = rand(1000,100000)."-".$_FILES['aphoto']['name'];
  22. $file_loc = $_FILES['aphoto']['tmp_name'];
  23. $file_size = $_FILES['aphoto']['size'];
  24. $file_type = $_FILES['aphoto']['type'];
  25. $folder="uploads/";
  26.  
  27. move_uploaded_file($file_loc,$folder.$file);
  28. //Insert Query of SQL
  29. $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."')");
  30.  
  31. echo "<br/><br/><span>Data Inserted successfully...!!</span>";
  32. }
  33. mysql_close($con); // Closing Connection with Server
  34. ?>
Add Comment
Please, Sign In to add comment