PHP
PHP
php
$servername = "localhost"; // Change this to your database server name
$username = "your_username"; // Change this to your database username
$password = "your_password"; // Change this to your database password
$dbname = "your_database_name"; // Change this to your database name
<!DOCTYPE html>
<html>
<head>
<title>Simple Form</title>
</head>
<body>
<h2>Simple Form</h2>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<label for="name">Name:</label>
<input type="text" name="name" id="name" required><br><br>
<label for="email">Email:</label>
<input type="email" name="email" id="email" required><br><br>
<label for="password">Password:</label>
<input type="password" name="password" id="password" required><br><br>
<label>Gender:</label>
<input type="radio" name="gender" value="Male" id="male"> <label for="male">Male</label>
<input type="radio" name="gender" value="Female" id="female"> <label
for="female">Female</label><br><br>
if (move_uploaded_file($_FILES["photo"]["tmp_name"], $targetFile)) {
// File uploaded successfully
$photo = $targetFile;
<!DOCTYPE html>
<html>
<head>
<title>Simple Form with Photo Upload</title>
</head>
<body>
<h2>Simple Form with Photo Upload</h2>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" enctype="multipart/form-
data">
<label for="name">Name:</label>
<input type="text" name="name" id="name" required><br><br>
<label for="email">Email:</label>
<input type="email" name="email" id="email" required><br><br>
<label for="password">Password:</label>
<input type="password" name="password" id="password" required><br><br>
<label>Gender:</label>
<input type="radio" name="gender" value="Male" id="male"> <label for="male">Male</label>
<input type="radio" name="gender" value="Female" id="female"> <label
for="female">Female</label><br><br>