Page 1 of 1

Inserting into MySQL question

Posted: Sat Oct 26, 2002 10:36 am
by Tom
Hey all,
I was just reading a tutorial on making a news script, when i came across this:

Code: Select all

$query = "INSERT INTO news(title, news, author, date)
VALUES('".$_POSTї'title']."','".$_POSTї'news']."','".$_POSTї'author']."', now())";
mysql_query($query);
What are the $_POST variables? I always see them, but never ever see where they're defined in any scripts.

Are the predefined by PHP or something? If they are, what do they mean?

Later all, - Tom

POST

Posted: Sat Oct 26, 2002 11:53 am
by AVATAr
Post variables are variables that came from a post of a form.

If you have a form that uses de $name variable on it.. after you submit (with the post action) you reach that variable by using $_POST["name"] (you pass the variable from de form to other page)

Look at: sticky...

hope it helps