use php process a web form feedback-insert data-continue1


Sandy | Full stack Web developer

you already  had a page collect information from use input, and build a page connect to your serves databases, here is the page use for process the data, (insert the information to your databases)

here is your process_chinese_zodaic.php page sourse code;

<?php
$sender = trim($_POST[‘fname’]);
$feedback =trim($_POST[‘feedback’]);
$agree = $_POST[‘agree’];
$submit = $_POST[‘submit’];
$error=0;

if(empty($sender)||empty($feedback))
{
echo “Your must write your first name,last name,feedback”;
++$error;
}
if($agree == 1)
{
$agree = “N”;

}
else
{
$agree = “Y”;
}
if($error == 0)
{
include(“inc_connect.php”);
if($DBConnect)
{
$table = “zodiacfeedback”;
$data = date(“Y-m-d”);
$time = date(“H:i:s”);
$query = “insert into $table(message_date,message_time,sender,message,public_message)values(‘$date’,’$time’,’$sender’,’$feedback’,’$agree’)”;
$result = @mysql_query($query);
if(!$result)
{
echo “<p>unable to insert the values “. mysql_error().”</p>”;
}
else
{
echo “<p>”.htmlentities($sender).”,Thanks you for giving us feedback.</p>”;
echo “<p><a href=’view_zodiac_feedback.php’>View all of the feedback</a></p>”;

}
mysql_close($DBConnect);
}

}

?>

View original post

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s