cd_catalog.xml html.html htmlpage.html out.html help.txt mysqlinit.txt signature.txt action.php action1.php actioni.php catalog.php catalog.save.php emailphp.php emailphptest.php emailphptext.php form.php form1.php formphp.php formphp1.php formphpi.php getcd.php getenv.php getenv1.php henrylogin.php mysqlcreate.php mysqlcreate1.php mysqlcreate2.php mysqlcreate3.php mysqlcreate4.php mysqlcreatei.php mysqlcreatetable.php mysqldel.php mysqldel1.php mysqldelete.php mysqldelete1.php mysqldeletei.php mysqldeli.php mysqldriver.php mysqldriver1.php mysqldriveri.php mysqldriversave.php mysqlinsert.php mysqlinsert1.php mysqlinserti.php mysqlitable.php mysqltable.php mysqltable1.php mysqltablei.php oopinsert.php out.php outout.php processscript.php processscript1.php sakila.php shuffle.php shufflesave.php tempstyle.php test1.php test2.php testfile.php testfname.php testpost.php testreceive.php testx.php testy.php style.css Number of files = 66 online compaq devendra athlon kingston kingston2 kingston3 kingston4 pi pi2 pi3 Page created on February 11th 2014 and updated on November 30th. 2017. Visitor number home launcher guestbook |
1. <HTML><HEAD><TITLE>Add a record to the database (from formphpi.php.)</TITLE>
2. <link rel="stylesheet" type="text/css" href="style.css"> 3. </HEAD> 4. <BODY><FONT FACE=ARIAL> 5. <H3>Add a record to the database (from formphpi.php.)</H3> 6. <?php 7. echo "Received data :- first name = "; 8. $fname= htmlspecialchars($_POST['fname']); echo $fname; 9. echo ", second name = "; 10. $sname= htmlspecialchars($_POST['sname']); echo $sname; 11. echo ", age = "; 12. $age = (int)$_POST['age']; echo $age; 13. echo " years.<BR>"; 14. $servername = "localhost"; 15. $username = "onwardov_henry"; 16. $password = "Xbloodychristmas7"; 17. $dbname = "onwardov_testdb1i"; 18. $con=mysqli_connect($servername, $username, $password, $dbname); 19. // Check connection 20. if (mysqli_connect_errno()) 21. { 22. echo "Failed to connect to $dbname " . mysqli_connect_error() . "<BR>\n"; 23. } 24. $sql = "INSERT INTO Persons (FirstName, LastName, Age) VALUES ('$fname' , '$sname' , '$age' )"; 25. if ($result=mysqli_query($con, $sql)) 26. { 27. echo $dbname . " has been updated. <BR><BR>\n"; 28. } 29. else 30. { 31. echo "Failure to add record to " .$dbname . " <BR>\n"; 32. } 33. mysqli_free_result($result); 34. mysqli_close($con); 35. ?> 36. <TABLE><TR><TD><form action=formphpi.php method="post"> 37. <input class="btn-secondary" type="submit" name="Next" value="Next"> 38. </form></TD> 39. <TD><form action=mysqltablei.php method="post"> 40. <input class="btn-secondary" type="submit" name="Display" value="Display"> 41. </form></TD> 42. <TD><FONT SIZE=1> Page created on December 16th. 2017.</TD> 43. </TR></TABLE> 44. </BODY></HTML> 45. |