Untitled
Anonymous
plain_text
06/27/2024 3:22 AM
1.6 KB
17
Indexable
<html>
<head>
<title>server connect</title>
</head>
<body>
<form action="insert.php" method="GET">
<p>Enter Name:</p>
<input type="text" placeholder="Your Name" id="name" name="abc">
<p>Enter Address:</p>
<input type="text" name="xyz" placeholder="Your Address">
<p>Enter Contact</p>
<input type="text" name="ccc" placeholder="No Country Code Needed">
<br>
<input type="submit" name="submit" value="submit">
</form>
</body>
</html>
<?php
$connect=mysqli_connect("localhost","root","","sectiona","3307");
?>
<?php
if(isset($_GET['submit'])){
$a=$_GET['abc'];
$b=$_GET['xyz'];
$c=$_GET['ccc'];
include 'connect.php';
$query="Insert into newtable(name, address, contact) VALUES('$a','$b','$c')";
$run=mysqli_query($connect,$query);
if ($run)
echo "Data Inserted";
else
echo "Data Not Inserted";
}
else{
echo "illegal access";
header ('location:newForm.html');
}
?>Editor is loading...
Leave a Comment