Html:
Recommended
Php:
$sql = "INSERT into Info_look (new_class) VALUES (' $_post[new_class_info] ')";
Yesterday sent a post, thank you for your help, there is a question at the time didn't think, is I $_post[new_class_info] here to get is the value, here I want to write, if written [new_class_info.value],php in the . is not the meaning of the +? Ask for answers
PS: And friends remind me that user input variables can not be inserted directly into SQL, because I am a beginner, here has not considered security issues, so currently only need to pass in value, can let my database record on it, thank you
Reply content:
Html:
Recommended
Php:
$sql = "INSERT into Info_look (new_class) VALUES (' $_post[new_class_info] ')";
Yesterday sent a post, thank you for your help, there is a question at the time didn't think, is I $_post[new_class_info] here to get is the value, here I want to write, if written [new_class_info.value],php in the . is not the meaning of the +? Ask for answers
PS: And friends remind me that user input variables can not be inserted directly into SQL, because I am a beginner, here has not considered security issues, so currently only need to pass in value, can let my database record on it, thank you
Your name attributes should be set on the select element. When a form is submitted, the form element is committed as a name-value pair, and the value of the attribute for the element is the name of the property, as the value of the attribute of the element select select name option value .
Like what
If the first option is checked, the foo=bar1 name value pair will be submitted.
If you commit using the Post method, you can use the $_POST array to access it in PHP, for example, the form above will have $_POST['foo'] this member, the value is 'bar1' .
Upstairs has been said very well, do not know the landlord understand no, I come to add some, the landlord said This is included in the (form) under this tag, defines the Action property indicates where the form is to be submitted, that is, your PHP. At the time of submission, the contents of the form key-value such a key value to your Php,key is the Name property of this tag, and value is the Value property, so the post to PHP is similar to this [' New_class_info ' = > ' recommend ', so all you have to do is get this array New_class_info item for example: $_post[' new_class_info ']