Professional Documents
Culture Documents
Front Form For User Registration
Front Form For User Registration
Front Form For User Registration
<html>
<body>
<h1>User Registration Form</h1>
<form method="POST" action="formData.php">
<label>Name</label> <input type="text" name="UserName" value="Ali Khan"
placeholder="Enter Name" >
<br>
<label>Email</label><input type="email" name="UserEmail"
placeholder="name@domain.com" >
<br>
<label>Password</label> <input type="password" name="UserPassword" ><br>
<label>Gender</label>
Male<input type="radio" name="gender" value="male" >
Female<input type="radio" name="gender" value="female">
<br>
User Pic <input type="file" name="UserPic" >
<br>
<?php
//Step-01 Database Connection
$host = 'localhost';
$db_user = 'root';
$db_pass = '';
$db_name = 'web';
// File Uploading (Move File into files folder & Save path into DB)
$fileName = $_FILES['UserPic']['name'];
$fileTmpPath = $_FILES['UserPic']['tmp_name'];
$fileSize = $_FILES['UserPic']['size'];
move_uploaded_file($fileTmpPath, 'files/'.$fileName);
$SavePicPath = 'files/'.$fileName;
if(!$results){
echo mysqli_error($db_connection);
}
else{
echo 'DATA SAVED';
}
}
?>
DB Table Structure