split fone number and add to database..

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
seeker2921
Forum Contributor
Posts: 120
Joined: Sat Mar 22, 2003 7:10 pm
Location: Wiesbaden Germany
Contact:

split fone number and add to database..

Post 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..
microthick
Forum Regular
Posts: 543
Joined: Wed Sep 24, 2003 2:15 pm
Location: Vancouver, BC

Post 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.
seeker2921
Forum Contributor
Posts: 120
Joined: Sat Mar 22, 2003 7:10 pm
Location: Wiesbaden Germany
Contact:

Post by seeker2921 »

Awsome.. Thats exactly what I needed
Post Reply