Posted by Phate on Wed 13th Jun 22:28
download | new post
- <? include("../include/config.php");
- ?>
- <!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=iso-8859-1" />
- <title>Add a Tournament</title>
- <title>Executing queries...</title>
- <style type="text/css">
- <!--
- body,td,th {
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 10px;
- color: #000000;
- }
- body {
- background-color: #999999;
- }
- -->
- </style>
- </head>
- <body>
- <?
- // Show the header
- echo "<p align=\"center\"><img src=\"../images/header.png\" alt=\"header\" width=\"1024\" height=\"150\" /></p>";
- // If we haven't clicked add yet, insert info in this table
- {
- echo "<h1> Add a Tournament </h1><br><br>";
- echo "We need the following info. Please make sure all fields are entered.<br>";
- echo "<form action=\"add.php\" method=\"post\">
- <table width=\"860\" height=\"689\" border=\"1\">
- <tr>
- <td width=\"158\">Tournament Name </td>
- <td width=\"686\"><input type=\"text\" name=\"name\" /></td>
- </tr>
- <tr>
- <td>Tournament Date </td>
- <td><input type=\"text\" name=\"date\" /></td>
- </tr>
- <tr>
- <td>Tournament Website </td>
- <td><input type=\"text\" name=\"website\" /></td>
- </tr>
- <tr>
- <td>Tournament Location </td>
- <td><input type=\"text\" name=\"location\" /></td>
- </tr>
- <tr>
- <td>Tournament Players Fee </td>
- <td><input type=\"text\" name=\"fee\" /></td>
- </tr>
- <tr>
- <td>Max Players </td>
- <td><input type=\"text\" name=\"maxplayers\" /></td>
- </tr>
- <tr>
- <td>Player Level </td>
- <td><input type=\"text\" name=\"level\" /></td>
- </tr>
- <tr>
- <td height=\"487\">Tournament Description </td>
- <td><textarea name=\"description\" cols=\"100\" rows=\"30\"></textarea></td>
- </tr>
- </table>
- <input name=\"add\" type=\"submit\" value=\"Add\" />
- </form>";
- }
- // If we have clicked add yet, add to db
- else
- {
- echo $dbname;
- // Include our config
- // Set Table name and query
- $table = $dbprefix . "info";
- $query = "INSERT INTO " . $table . " (date, name, website, location, playersfee, maxplayers, level, description) VALUES('$_POST['date']', '$_POST['name']', '$_POST['website']', '$_POST['location']', '$_POST['fee']', '$_POST['maxplayers']', '$_POST['level']', '$_POST['description']')";
- // Now connect to the db and select it
- // Execute the query = Insert info into db
- // Echo success! And continue
- echo "Success! Tournament added!<br>";
- echo "<a href=\"control.php\"><img src=\"images/next.png\" alt=\"next\" width=\"61\" height=\"61\" border=\"0\"/></a>";
- }
- ?>
Submit a correction or amendment below. (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.