Good Morning:
I'm featuring a hall of fame on my website that will allow visitors to submit nominees via a form. I want the form data to be submitted to another page/MySQL database. Here's what I have so far:
The HTML form page rebootwwehof.html
<!DOCTYPE html>
<HTML>
<HEAD>
<TITLE>WWE Hall of Fame</TITLE>
</HEAD>
<BODY BGCOLOR=#000000 LINK=#FFFFFF VLINK=#FFFFFF>
<FONT FACE="Arial" COLOR=#FFFFFF>
<BR>
<BR>
<P>It's been said that no Hall of Fame is perfect and certainly the WWE Hall of Fame has gotten its share of criticisms.
However, with this project, I am rebooting the WWE Hall of Fame and inviting people to
create the perfect WWE Hall of Fame with nominations and votings. On this page, you can submit
individuals (whether wrestlers, managers, referees, announcers, promoters) worthy of induction. The names
receiving the most nominations will form the initial ballot. There will be two rounds of voting. Nominees
must receive at 75% of votes to move on the next round. Anyone receiving at
least 70% but less than 75% will be included on next year's ballot. The
nomination period will last from April 15 to June 15.
<BR>
<BR><B>Criteria</B>
<BR>
<UL>
<LI>Work (as wrestler, manager, announcer, staff or promoter) for WWE any period from its beginning as Capitol Wrestling Corporation (CWC) days to modern day WWE</LI>
<LI>Drawing power, merchandise sales, achievement</LI>
<LI>Influence or significance in WWE history</LI>
<LI>Age of at least 50 years</LI>
<UL>
<LI><B>Exception:</B> being deceased for at least two and a half years
</UL>
</UL>
</P>
<BR>
<BR>
<P>Make your nominations in the form below</P>
<FORM NAME="input" ACTION="http://mvwres.awardspace.us/almanac/rebootwwenominees.php" METHOD="post">
<P>E-mail:<BR> <?PHP ECHO $_POST['email']; ?><INPUT TYPE="text" NAME="email"></P>
<P>Nominees:<BR> <?PHP ECHO ($_POST['nominee']); ?><TEXTAREA NAME="nominees" ROWS="10" COLS="40">
</TEXTAREA></P>
<INPUT TYPE="submit" VALUE="Submit"><INPUT TYPE="reset" VALUE="Reset">
</FORM>
</BODY>
</HTML>
Here's the page to process the data rebootwwenominees.php:
<HTML>
<BODY>
<HEAD>
<TITLE>WWE Hall of Fame Nominations</TITLE>
</HEAD>
<?
$email = $_POST['email'];
$nominee = $_POST['nominee'];
mysql_connect("fdb2.awardspace.com", "mvwi1_newwwehof", "konc!abr") or die(mysql_error());
mysql_select_db("mvwi1_newwwehof") or die(mysql_error());
mysql_table = 'WWE_HOF_Nominator';
mysql_query("INSERT INTO `data` VALUES ('$email', 'nominee')");
Print "Your information has been successfully added to the database.";
?>
</BODY>
</HTML>
Am I missing anything?
Okay I've since updated my code and still having issues (albeit long break in between). I keep getting an unexpected T_string error on the $con line.
<?php
$servername = "sql204.byethost9.com";
$username = "b9_18261515";
$password = "brother1";
$dbname = "b9_18261515_mockwwe";
// Create connection
$con = mysqli_connect("sql204.byethost9.com", "b9_18261515", "brother1", "b9_18261515_mockwwe");
// Check connection
if (!$con) {
die("Connection failed: " . mysqli_connect_error());
}
mysqli_select_db($con,"b9_18261515") or die ("no database");
$sql = "INSERT INTO WWE_HOF_Nominator (email, nominees) VALUES ('$email', '$nominees')";
if (mysqli_query($con, $sql)) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($con);
}
mysqli_close($con);
?>