processing multiple textfields with php
Posted: Tue Dec 29, 2009 3:20 pm
Hello,
I'm new to PHP and I have 2 questions about processing an HTML form.
1. I'm building a PHP site and I have a form that uses 3 text input fields to capture a phone number, so a field for the area code, and 2 fields for the other parts of the number. I want to store the whole phone number in a single field in MySQL. My question is how can I get the $_POST array to store only my concatenation of the whole phone number, and delete the 3 elements that represent each text input field for the phone number?
Also,
2. How can I make a sticky selection list? I have selection lists that store the 50 states and some years for birthdates. I want to preserve those selections if someone is brought back to the form due to an input error. I know there's a way to do it, but I haven't figured it out.
I'm using Windows XP, PHP 5, MySQL 5, and Internet Explorer. I'm coding in Dreamweaver.
Thank you very much,
Nick
I'm new to PHP and I have 2 questions about processing an HTML form.
1. I'm building a PHP site and I have a form that uses 3 text input fields to capture a phone number, so a field for the area code, and 2 fields for the other parts of the number. I want to store the whole phone number in a single field in MySQL. My question is how can I get the $_POST array to store only my concatenation of the whole phone number, and delete the 3 elements that represent each text input field for the phone number?
Also,
2. How can I make a sticky selection list? I have selection lists that store the 50 states and some years for birthdates. I want to preserve those selections if someone is brought back to the form due to an input error. I know there's a way to do it, but I haven't figured it out.
I'm using Windows XP, PHP 5, MySQL 5, and Internet Explorer. I'm coding in Dreamweaver.
Thank you very much,
Nick