Need help with PHP Forms?
-
I'm a complete beginner in PHP so I'm not too sure how to code this. I have two php pages: registration.php & outcome.php There is a registration form on the registration.php page. The user needs to type in his/her first name and last name. After the user clicks submit, the value that was in the input field will be copied over to the outcome.php page. <form method = "post" action = "destination.php"> First Name: <input type="text" name="fname"/> </br> Last Name: <input type="text" name="lname"/> </br> <input type = "submit"/> </form> I need to make sure that the first and last name fields are longer than 1 letter. How can I do that? I know I need to use if statements but I just don't understand how to code it. Thank you for your help!
-
Answer:
To reload the form, I think it would be simpler to put both the form and result in to the same file. Just if and else statements to decide which page to show. To check the length, I think there was strlen() function. Something like: if (strlen($_POST['fname']) > 1) { }
lunar at Yahoo! Answers Visit the source
Related Q & A:
- I need help on what I need to buy or do.Best solution by Yahoo! Answers
- I need help with some horse questions, can you help me.Best solution by Yahoo! Answers
- I did something really bad and now i need help please help me.Best solution by Yahoo! Answers
- What sort of opportunities are there to help people in Africa or places where people need help?Best solution by Yahoo! Answers
- Why are HTML and PHP forms not working?Best solution by Yahoo! Answers
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.