PHP-Post Data
<?php
if(isset($_POST['submit']))
{
$name = $_POST['name'];
$email=$_POST['email'];
$phone=$_POST['phone'];
$comment=$_POST['comment'];
mysql_connect("localhost","root","");
mysql_select_db("register_form");
$data=mysql_query("insert into quick_contact values('','$name','$email','$phone','$comment')");
if($data)
{
echo "<script>alert('Your post jobs has been submitted successfully')</script>";
/*
echo "<script>location='files/post_jobs.php'</script>";
*/
}
else
{
echo"<script>alert('your post not submited')</script>";
echo mysql_error();
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>
Working with web forms
</title>
<style type="text/css">
table {
font-family:verdana;
}
td {
height:30px;
padding-left:2%;
}
tr {
height:50px;
}
.form-post-job {
width:80%;
margin:0px auto;
}
.form-post-job ul li {
line-height:35px;
margin:8px 0px;
}
.form-post-job ul li input {
height:40px;
width:30%;
padding-left:10px;
}
</style>
</head>
<body bgcolor="#f1f1f1">
<form name="webform" action='' method="post" id="webform" class="webformcss">
<table width="100%" border="0" align="center" bgcolor="#cccccc">
<tr>
<th colspan="2">Post for Employee Details</th>
</tr>
</table>
<div class="form-post-job">
<ul style="list-style:none; font-family:verdana;">
<li>
<input type="text" name="name">
</li>
<li>
<input type="email" name="email">
</li>
<li>
<input type="tel" name="phone">
</li>
<li>
<textarea rows=3 cols="20" name="comment"></textarea>
</li>
<li>
<input type="submit" name="submit" id="submit" class="button">
</li>
</form>
</div>
</body>
</html>
if(isset($_POST['submit']))
{
$name = $_POST['name'];
$email=$_POST['email'];
$phone=$_POST['phone'];
$comment=$_POST['comment'];
mysql_connect("localhost","root","");
mysql_select_db("register_form");
$data=mysql_query("insert into quick_contact values('','$name','$email','$phone','$comment')");
if($data)
{
echo "<script>alert('Your post jobs has been submitted successfully')</script>";
/*
echo "<script>location='files/post_jobs.php'</script>";
*/
}
else
{
echo"<script>alert('your post not submited')</script>";
echo mysql_error();
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>
Working with web forms
</title>
<style type="text/css">
table {
font-family:verdana;
}
td {
height:30px;
padding-left:2%;
}
tr {
height:50px;
}
.form-post-job {
width:80%;
margin:0px auto;
}
.form-post-job ul li {
line-height:35px;
margin:8px 0px;
}
.form-post-job ul li input {
height:40px;
width:30%;
padding-left:10px;
}
</style>
</head>
<body bgcolor="#f1f1f1">
<form name="webform" action='' method="post" id="webform" class="webformcss">
<table width="100%" border="0" align="center" bgcolor="#cccccc">
<tr>
<th colspan="2">Post for Employee Details</th>
</tr>
</table>
<div class="form-post-job">
<ul style="list-style:none; font-family:verdana;">
<li>
<input type="text" name="name">
</li>
<li>
<input type="email" name="email">
</li>
<li>
<input type="tel" name="phone">
</li>
<li>
<textarea rows=3 cols="20" name="comment"></textarea>
</li>
<li>
<input type="submit" name="submit" id="submit" class="button">
</li>
</form>
</div>
</body>
</html>
Comments
Post a Comment