javascript - How to put values of textbox into variable in PHP? -
i want add values mysql
database using php
. values want add, come text-boxes of form. tried $variable = $_post['formelementname']
, used $variable
insert values. doesn't work.
question:
how can put values of text-boxes variables?
thanks.
i want elaborate @kyle wrote
note: form method post
html part
<form action="your_php_file_name.php" method="post"> <input type="text" name="first_name" /> <input type="submit" value="submit" /> </form>
php part: file name is: your_php_file_name.php
<?php //a practice check type of http request $fname = $_post['first_name']; ?>
some practices
- check http request type sent client side. (i find way)
- sanitize variables before inserting.
Comments
Post a Comment