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

  1. check http request type sent client side. (i find way)
  2. sanitize variables before inserting.

Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -