<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Comment</title>
<style type="text/css">
<!--
body {
background-image: url(
Http://www.hereisfun.com/images/backgroundfun.jpg);
background-repeat: repeat;
}
-->
</style>
</head>
<body>
<table width="200" height="500" border="0" cellspacing="1" cellpadding="1" align="center">
<tr>
<td><font color="#FFFFFF"><form method="post" action="maybe.php">
<label for="firstname">First Name:</label>
<input type="text" id="firstname" name="firstname" /><br />
<label for="lastname">Last Name:</label>
<input type="text" id="lastname" name="lastname" /><br />
<label for="email">email:</label><br />
<input type="text" id="email" name="email" /><br />
<label for ="comment">Comment: </label>
<input name="comment" type="text" id="comment" value="" /><br />
<input type="submit" value="Enter Comment" name="submit" />
</form></font>
</td>
</tr>
</table>
</body>
</html>
And here is my other page that the form goes to
<html>
<head>
<title> Thank you for entering your comment. </title>
</head>
<body>
<?php
$firstname = $_POST[ 'firstname' ];
$lastname = $_POST[ 'lastname' ];
$email = $_POST[ 'email' ];
$comment = $_POST[ 'comment' ];
$dbc = mysqli_connect('databaselocation', 'mysql username', 'mysq password', 'database')
or die('Error connectiong to MYSQL server.');
$query = "INSERT INTO cmmnts (first_name, last_name, email, cmmnt) " .
"VALUES ('$firstname', '$lastname', '$email', '$comment')";
$result = mysqli_query($dbc, $query) or die('Error querying database.');
mysqli_close($dbc);
echo 'Thanks for submitting the form into the database!<br />';
echo ' ' . $firstname;
echo ' ' . $lastname . '<br />';
echo 'Email: ' . $email . '<br />';
echo 'Comment: ' . $comment . '<br />';
?>
<p><a href="form.php"> Post another comment. </a></p>
</body>
All of this works it just puts the stuff into the database
it doesnt put it on my site :/
i changed to password and database location and stuff but im 100% they work