I have a form input box with it's value set like this:
input type = "text" value="Journal Title (Optional)" onFocus="this.value=''" name = "Journal_Title"
If the user does not change the title (from Journal Optional) I do not want "journal optional" to be stored in the db as the name but want this field left as blank if it has been untouched.
Here is where I add it to the DB, could someone tell me how to make this change?
$title = mysql_real_escape_string($_POST['Journal_Title']);
$content = mysql_real_escape_string($_POST['Journal_Content']);
if ( strlen($title) > 1 && strlen($content) > 1 )
// Inserting data in the database
if ( mysql_query("INSERT INTO journal_table (user_id, entry_title, entry_text) VALUES('$username','$title','$content')") )
$_SESSION[$outcome] = "Journal successfully added!";