Professional Documents
Culture Documents
php
//Databse Connection file
include('dbconnection.php');
if(isset($_POST['submit']))
{
$firstname=$_POST['firstname'];
$telephone=$_POST['telephone'];
$email=$_POST['email'];
$address=$_POST['address'];
$city=$_POST['city'];
$state=$_POST['state'];
$kind=$_POST['kind'];
$ppic=$_FILES["profilepic"]["name"];
// get the image extension
$extension = substr($ppic,strlen($ppic)-4,strlen($ppic));
// allowed extensions
$allowed_extensions = array(".jpg","jpeg",".png",".gif",".JPG");
// Validation for allowed extensions .in_array() function searches an array for a
specific value.
if(!in_array($extension,$allowed_extensions))
{
echo "<script>alert('Invalid format. Only jpg / jpeg/ png /gif/JPG format
allowed');</script>";
}
else
{
//rename the image file
$imgnewfile=md5($imgfile).time().$extension;
// Code for move image into directory
move_uploaded_file($_FILES["profilepic"]["tmp_name"],"profilepics/".$imgnewfile);
// Query for data insertion
$query=mysqli_query($con, "insert into
reg2(firstname,telephone,email,address,city,state,kind,ProfilePic)
value('$firstname','$telephone','$email','$address','$city','$state','$kind','$imgn
ewfile')");
if ($query) {
echo "<script>alert('You have successfully inserted the data');</script>";
echo "<script type='text/javascript'> document.location ='thanks.html'; </script>";
} else{
echo "<script>alert('Something Went Wrong. Please try again');</script>";
}}
}
?>
<div class="searchcontainer">
<div class="row">
<div class="col-75">
<div class="container">
<div class="row">
<div class="col-25">
<label for="fname"><h1>Registration</h1></label> <br>
<h1>
<a href="index.html">Home</a>
</h1>
<div class="row">
<div class="col-50">
<label for="state">Date de naissance</label>
<div>
<label for="state">Kind of trainning</label>
<option value="select">select</option>
<option value="Jujitsui">jujitsui</option>
<option value="Judo">Judo</option>
<option value="kempo">Kempo</option>
<option value="Kungfu">Kungfu</option>
<option value="Kickboxing">Kickboxing</option>
<option value="Box">Box</option>
<option value="karate">karate</option>
<option value="Teakwendo">Teakwendo</option>
<option value="Cross fit">Cross fit</option>
<option value="Airobic">Airobic</option>
<option value="Gymnastique">Gymnastique</option>
</select>
</div>
</div>
<br><br><br>
</form>
</div>
</div>
</span>
<style>
body{
@media screen{max-width: 1000px;}
min-width: 1000px;
background: url("kick boxing.jpg") no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover
}
.container {
input[type=text] {
width: 70%;
margin-bottom: 20px;
padding: 15px;
border: 2px solid #ccc;
border-radius: 10px;
}
label {
margin-bottom: 15px;
display:block;
}
.icon-container {
margin-bottom: 30px;
padding: 7px 7;
font-size: 20px;
}
.a{
background-color:blue;
color: white;
padding: 15px;
margin: 50px 50;
border: none;
width: 50%;
border-radius: 10px;
cursor: pointer;
font-size: 20px;
}
span.price {
float: right;
color: grey;
}
/* Responsive layout - when the screen is less than 800px wide, make the two
columns stack on top of each other instead of next to each other (and change the
direction - make the "cart" column go on top) */
@media (max-width: 600px) {
.row {
flex-direction: column-reverse;
}
.col-25 {
margin-bottom: 50px;
}
}
</style>
</div>
</div>
</body>
</html>