hello im newish to php and am building a news submit and see part to my site!
<form action="insert12.php" method="post">
Title: <input type="text" name="title" value"<? echo $form->value("title"); ?>" />
Text: <input type="text" name="text" value"<? echo $form->value("text"); ?>" />
<input type="submit" />
</form>
<?php
if(empty($title) || empty($text)) exit("You didn't completely fill in the form!");
// we're presuming here that you used 'title' and 'text' as the names for your form elements
$title = addslashes($title);
$text = addslashes($text);
// add slashes to the sent info so no escape characters are around (they'll possibly bust the script)
mysql_query("INSERT INTO news (title,text) VALUES ('$title','$text')"); ?>
this is the code, it works and i get the code submitted and showing on screen! however, the "you didnt fill in form" line is always there no matter whether i have completed the form or not! any ideas?