Using form buttons to submit text data in php?
-
In php, I created a page where a user types his name in and hits a button submit created right below the text field. The trouble I'am having is I'am not quite sure how to code the part once the user hits the submit button the data in the text area gets stored in a variable? Thank you greatly for any help
-
Answer:
<?php $name = $_POST['name']; ?> in this case the name of the name field (ie <input type="text" name="NAME" />) would be name. if the field's name was password, it would be $_POST['password']; it is good protocol to escape these strings from sql injection attacks so use $name = mysql_real_escape_string($_POST['name'])… Good luck!
Steve at Yahoo! Answers Visit the source
Related Q & A:
- How to Write Form Data to XML?Best solution by Stack Overflow
- How to submit a form using httpurlconnection?Best solution by stackoverflow.com
- How to store data in php and get data from php?Best solution by Stack Overflow
- Why am I receiving a malformed text data error and how do I fix it?Best solution by Yahoo! Answers
- What is an easy code for a form in PHP?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.