Heres the code for the form submission page. Obviously something has got to be wrong. Ideally i don't want to be able to change the date and time so i want to get rid of those areas and just have input for title and content. That's a seperate issue i can solve on my own. Can anyone tell me what's wrong with the timestamp function?
Thanks
<?php
if (isset($_POST['submit'])) {
$month = htmlspecialchars(strip_tags($_POST['month']));
$date = date("m d Y");
$year = htmlspecialchars(strip_tags($_POST['year']));
$time = htmlspecialchars(strip_tags($_POST['time']));
$title = htmlspecialchars(strip_tags($_POST['title']));
$entry = $_POST['entry'];
$timestamp = "strtotime($month . ” ” . $date . ” ” . $year . ” ” . $time)";
$entry = nl2br($entry);
if (!get_magic_quotes_gpc()) {
$title = addslashes($title);
$entry = addslashes($entry);
}
mysql_connect (DELETED FOR PRIVACY) ;
mysql_select_db (DELETED FOR PRIVACY);
$sql = "INSERT INTO php_blog (timestamp,title,entry) VALUES ('$timestamp','$title','$entry')";
$result = mysql_query($sql) or print("Can’t insert into table php_blog.<br />" . $sql . "<br />" . mysql_error());
if ($result != false) {
print "Your entry has successfully been entered into the database.";
}
mysql_close();
}
?>
<?php
$current_month = date("F");
$current_date = date("d");
$current_year = date("Y");
$current_time = date("H:i");
?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<p><strong><label for="month">Date (month, day, year):</label></strong>
<select name="month" id="month">
<option value="<?php echo $current_month; ?>"><?php echo $current_month; ?></option>
</select>
<input type="text" name="date" id="date" size="2" value="<?php echo $current_date; ?>" />
<select name="year" id="year">
<option value="<?php echo $current_year; ?>"><?php echo $current_year; ?></option>
</select>
<strong><label for="time">Time:</label></strong> <input type="text" name="time" id="time" size="5" value="<?php echo $current_time; ?>" /></p>
<p><strong><label for="title">Title:</label></strong> <input type="text" name="title" name="title" size="40" /></p>
<p><textarea cols="80" rows="20" name="entry" id="entry"></textarea></p>
<p><input type="submit" name="submit" id="submit" value="Submit"></p>
</form>