You are on page 1of 4

<?

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>

<form enctype="multipart/form-data" action="" name="form" method="post">

<label for="fname"><i class="fa fa-user"></i> Nom et pr�nom</label>

<input type="text"name="firstname" placeholder="M ALA. Din"required


autocomplete="off">

<label for="numr"><i class="fa fa-user"></i> numero telephone</label>

<input type="text"name="telephone" placeholder="56234892"required


autocomplete="off">

<label for="email"><i class="fa fa-envelope"></i> Email</label>

<input type="text"name="email" placeholder="aladin@example.com"required


autocomplete="off">

<label for="adr"><i class="fa fa-address-card-o"></i> Address</label>

<input type="text"name="address" placeholder="20 mars. kalaa


kbira"required autocomplete="off">

<label for="city"><i class="fa fa-institution"></i> City</label>

<input type="text"name="city" placeholder="sousse"required


autocomplete="off">

<div class="row">
<div class="col-50">
<label for="state">Date de naissance</label>

<input type="text"name="state" placeholder="22/01/2011"required


autocomplete="off">
</div><br><br>

<div>
<label for="state">Kind of trainning</label>

<select name="kind"style="width:100px; border-radius: 5px;


height:40px; font-family:Calibri, sans-serif; font-size:small; background-
color:white; border-color:gray">

<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>

<input type="file" class="form-control" name="profilepic"


required="true">
<span style="color:red; font-size:12px;">Only jpg / jpeg/ png /gif format
allowed.</span>allowed.</span><br><br>

</div>

<br><br><br>

<input type="submit"name="submit"value="save your inscription"class="a">

</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 {

padding: 20px 15px 0px 120px;

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>

You might also like