Page 1 of 1

split fone number and add to database..

Posted: Tue Feb 03, 2004 4:16 pm
by seeker2921
I have a form that asks for your fone number and what I want to do is have three text boxs for that number How would I do this and be able to add it to the same database field becuase I can only figuare out how to do it if I have three database fields for the number and I don't want that..

Posted: Tue Feb 03, 2004 4:24 pm
by microthick
Well, you'll call these fields phone1, phone2, and phone3 or something.

The customer will fill in the form and press submit. On the form processing page, make a new variable $phone that concatenates all three form variables.

$phone = $_POST["phone1"] . $_POST["phone2"] . $_POST["phone3"];

The phone number will look like 1112223333, if they entered in 111 and 222 and 3333 in the boxes.

Posted: Tue Feb 03, 2004 5:44 pm
by seeker2921
Awsome.. Thats exactly what I needed