Hi there, I am trying to insert some data into my database, and although a row is being created, none of the user's data is entering the database, and I was hoping someone could explain why. Here is my form: and here is insert.php:
In your webform you didn't provide the method. You need to add METHOD="POST", because your reading in your $_post var. I strongly suggest you get a good variable cleaning function before you insert anything into SQL.
yeah... or else give me your domain name so i can run a sql injection on your DB... jus kidding... clean your data before sending into the DB. cheers
Setting form method is the same as adding a name to your input fields ! If you don't set one of these - your form will not work ( in case if there are no name for input field or method is not set correctly, you will not be able to use it ).
<form name="answer" action="read.php" method="GET"> <form name="answer" action="read.php" method="POST"> PHP: