Hello all.
For some odd reason, I try and use an HTML form to insert certain values into a database. In the HTML form, I dont' know what's going on, but it seems that the INSERT function isn't working, or the values aren't being submitted. Any help would be appreciated.
HTML Form
<form action="scripts/modify/addItem.php" method="POST" name="add">
Title: <input type="text" size="30" name="title" /><br />
Short Text:<br /><textarea cols="32" rows="15" name="short"></textarea><br />
Extended Text:<br /><textarea cols="32" rows="15" name="extnd"></textarea><br />
<input type="hidden" name="item" value="stories" />
<input type="hidden" name="pid" value="1" />
<input type="submit" value="Add Story" />
PHP addItem Script
<?php
//
// Add Items to the DB
//
$title = $_GET['title'];
$short = $_GET['short'];
$extnd = $_GET['extnd'];
$date = date("F j, Y");
include("connection.php");
$query = "INSERT INTO `stories` (Date, Title, Short, Extnd) VALUES ('$date', '$title', '$short', '$extnd')";
$result = mysql_query($query, $dbc);
if($result == true){
echo('Successfully entered into database');
echo('<a href="http://winfieldvfd.org/admin/index.php?=1">Back</a>');
}
else{
echo('Unable to insert values. Try again.<br />');
echo(mysql_errno().'<br />'.mysql_error());
echo('<br />Table, Title, Short, Extnd');
echo($table.'<br />==========');
echo($title.'<br />==========');
echo($short.'<br />==========');
echo($extnd.'<br />');
}
?>