Jump to content

[SOLVED] <input> not posting


camdenite

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.