camdenite Posted February 11, 2009 Share Posted February 11, 2009 Hi all, I've got this: <form action="create_blog.php" method="post"> <td>Category Code<br /> (enter 2-digit code from list on right):<br /> <input type="text" name="category_id" size="5"/></td></tr> <tr> <td valign="top">First Paragraph: <br /> <textarea name="first_para" cols="60" rows="6" /></textarea></td> very basically.The textarea posts but the input doesn't. I've also got this to go with it: // Check for a category_id. if (empty($_POST['category_id'])) { $errors[] = 'You forgot to enter a Category ID.'; } else { $header = escape_data($_POST['category_id']); } // Check for a page title. if (empty($_POST['first_para'])) { $errors[] = 'You forgot to enter a First Paragraph.'; } else { $first_para = escape_data($_POST['first_para']); } and this: $query = "INSERT INTO blogb (date2, heading, category_id, first_para, entry, more) VALUES ('$date2', '$heading', '$category_id', '$first_para', '$entry', '$more')"; $result = @mysql_query ($query); // Run the query. if ($result) { // If it ran OK. No errors so no idea why it doesn't insert category_id into the database. I put this in my script: ini_set ("display_errors", "1"); error_reporting(E_ALL); And there is nothing in the error log on the server. Please help. Cheers, Colin Link to comment https://forums.phpfreaks.com/topic/144764-solved-not-posting/ Share on other sites More sharing options...
camdenite Posted February 11, 2009 Author Share Posted February 11, 2009 I should say that first_para does post but that's in a textarea... Link to comment https://forums.phpfreaks.com/topic/144764-solved-not-posting/#findComment-759603 Share on other sites More sharing options...
deansatch Posted February 11, 2009 Share Posted February 11, 2009 First thing I notice is your html is wrong. You have a closing tag on your textarea Change: <textarea name="first_para" cols="60" rows="6" /></textarea> To: <textarea name="first_para" cols="60" rows="6"></textarea> for a start Link to comment https://forums.phpfreaks.com/topic/144764-solved-not-posting/#findComment-759606 Share on other sites More sharing options...
deansatch Posted February 11, 2009 Share Posted February 11, 2009 Should this: $header = escape_data($_POST['category_id']); not be: $category_id= escape_data($_POST['category_id']); ?????? Link to comment https://forums.phpfreaks.com/topic/144764-solved-not-posting/#findComment-759607 Share on other sites More sharing options...
camdenite Posted February 11, 2009 Author Share Posted February 11, 2009 I'm so thick - I'm surprised my bum doesn't fall off :-\ Thanks Deansatch - that sorted it. And my html. Cheers. Link to comment https://forums.phpfreaks.com/topic/144764-solved-not-posting/#findComment-759611 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.