Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $name = $_POST["name"];
- $email = $_POST["email"];
- $location=$_POST["location"];
- $org_category=$_POST["organization_category"];
- $org_name=$_POST["organization_name"];
- $application_website=$_POST["resource"];
- $procedure=$_POST["selection_procedure"];
- $eng_stream=$_POST["engineering_stream"];
- $domain=$_POST["internship_domain"];
- $intern_experience=$_POST["intern_exp"];
- $intern_prep=$_POST["preparation"];
- $intern_year=$_POST["intern_year"];
- $anonymous=$_POST["anonymous"];
- $no_of_sub=$_POST["no_of_sub"];
- //$dateandtime=now();
- $dateandtime=date('Y-m-d H:i:s');
- $prof_name=$_POST["professor_name"];
- $application_procedure=$_POST["application_procedure"];
- $ratingDifficulty=$_POST["ratingDifficulty"]-3;
- $learningExp=$_POST["learn"];
- $existingKnowledge=$_POST["existing"];
- $servername = "mysql11.000webhost.com";
- $username = "a4078960_exampre";
- $password = "Swagita@1605";
- $dbname = "a4078960_exampre";
- $last_id=0;
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " .$conn->connect_error);
- }
- else {
- }
- $sql = "INSERT INTO Intern
- VALUES (NULL,'".$email."' , '".$name."','".$location."', '".$org_category."','".$prof_name."', '".$org_name."', '".$application_website."', '".$application_procedure."','".$procedure."', '".$eng_stream."', '".$domain."', '".$intern_experience."', '".$intern_prep."','".$ratingDifficulty."','".$learningExp."','".$existingKnowledge."','".$intern_year."','".$anonymous."','".$dateandtime."')";
- if ($conn->query($sql) === TRUE) {
- $GLOBALS['last_id'] = $conn->insert_id;
- echo "New record created successfully";
- } else {
- echo "Error: " . $sql . "<br>" . $conn->error;
- }
- if($_POST["subject0"]!=NULL ||$_POST["question0"]!=NULL)
- {
- $sqli = "INSERT INTO Intern_Technical VALUES (NULL,'".$GLOBALS['last_id']."','".$_POST["subject0"]."','".$_POST["question0"]."')";
- $conn->query($sqli);
- }
- if($_POST["subject1"]!=NULL ||$_POST["question1"]!=NULL)
- {
- $sqli = "INSERT INTO Intern_Technical VALUES (NULL,'".$GLOBALS['last_id']."','".$_POST["subject1"]."','".$_POST["question1"]."')";
- $conn->query($sqli);
- }
- if($_POST["subject2"]!=NULL ||$_POST["question2"]!=NULL)
- {
- $sqli = "INSERT INTO Intern_Technical VALUES (NULL,'".$GLOBALS['last_id']."','".$_POST["subject2"]."','".$_POST["question2"]."')";
- $conn->query($sqli);
- }
- if($_POST["subject3"]!=NULL ||$_POST["question3"]!=NULL)
- {
- $sqli = "INSERT INTO Intern_Technical VALUES (NULL,'".$GLOBALS['last_id']."','".$_POST["subject3"]."','".$_POST["question3"]."')";
- $conn->query($sqli);
- }
- $conn->close();
- ?>
Add Comment
Please, Sign In to add comment