<!
DOCTYPE HTML>
<html>
<head>
</head>
<body>
<?php
include('db.php');
if ($_SERVER["REQUEST_METHOD"] == "POST"){
$name=$_POST["name"];
$email=$_POST["email"];
$website=$_POST["website"];
$connect=$_POST["connect"];
$gender=$_POST["gender"];
if ($_SERVER["REQUEST_METHOD"]== "POST"){
$sql = "insert into profile (name,email,website,connect,gender) values
('$name','$email','$website','$connect','$gender')";
if (mysqli_query($conn,$sql)){
echo "<br> Record created successfully";
?>
<h2>PHP Fom Validation Example</h2>
<form method="POST" action="<?php echo htmlspecialchars ($_SERVER["PHP_SELF"]) ;?>">
Name: <input type="text" name="name" >
<br><br>
E-mail: <input type="text" name="email">
<br><br>
Website: <input type="text" name="website">
<br><br>
Comment: <textarea name="connect" rows="5" cols="40"></textarea>
<br><br>
Gender: <input type="radio" name="gender" value=" female">
Female <input type="radio" name="gender" value="'male">
Male <input type="radio" name="gender" value="other">Other
<br><br>
<input type="submit" name="submit" value=" Submit"> </form> </body> </htm?>
</form>
</body>
</html>
<?php
$server ="localhost";
$user= "root";
$pw ="";
$db ="rz";
$conn = mysqli_connect($server,$user,$pw,$db);
if ($conn===false){
die ("error:we are not connected to each other".mysqli_connect_error());
?>