hardhead04 Posted August 2, 2003 Share Posted August 2, 2003 Can anyone tell me how i can get my database to retrieve full phone numbers without asking my users to type their phone numbers without spaces. The only information that gets to my database is the numbers before the a space or dash. Example: 312-432-5932 or 312 432 5932 My database only recieves the \"312\" which are the numbers before the space. I will be very greatfull if someone can help me wit this. Thanx Quote Link to comment https://forums.phpfreaks.com/topic/821-phone-number-retrieval/ Share on other sites More sharing options...
lonerngraus Posted August 2, 2003 Share Posted August 2, 2003 Hey, I\'m new at this also, but I would have \"thought\" that on the form you could seperate the area code, phone number etc.. limit the field sizes to the number of digitis required.. and place some javascript to ensure they entered in the required number of digits. That way you could append the data together, and send it off as a single digit? Cheers Quote Link to comment https://forums.phpfreaks.com/topic/821-phone-number-retrieval/#findComment-2717 Share on other sites More sharing options...
hardhead04 Posted August 3, 2003 Author Share Posted August 3, 2003 Alright thanx i did that. but how do i go about appending the data in those three seperate forms to the same record in the database? Quote Link to comment https://forums.phpfreaks.com/topic/821-phone-number-retrieval/#findComment-2730 Share on other sites More sharing options...
holiks Posted August 3, 2003 Share Posted August 3, 2003 ..maybe something along the lines of.... <form> <input type="text" size="3" name="areacode" maxlength="3"> - <input type="text" size="3" name="number1" maxlength="3"> - <input type="text" size="4" name="number2" maxlength="4"> <br> <input type="submit" value="submit"> </form> Quote Link to comment https://forums.phpfreaks.com/topic/821-phone-number-retrieval/#findComment-2737 Share on other sites More sharing options...
hardhead04 Posted August 3, 2003 Author Share Posted August 3, 2003 thanx but i already did that but the database is only recieving the last 4 digits of the phone number. which is \"number2\" in your example. the information in \"areacode\" and \"number1\" is lost. Should I change the record values in the database or should i make seperate records for \"area code\", \"number1\", and \"number2\" in the database. Quote Link to comment https://forums.phpfreaks.com/topic/821-phone-number-retrieval/#findComment-2740 Share on other sites More sharing options...
BinaryStar Posted August 4, 2003 Share Posted August 4, 2003 just go like this... [php:1:c2d757dd8a]<?php $complete_phone = $area_code . $number1 . $number2; ?>[/php:1:c2d757dd8a] BS Quote Link to comment https://forums.phpfreaks.com/topic/821-phone-number-retrieval/#findComment-2742 Share on other sites More sharing options...
hardhead04 Posted August 4, 2003 Author Share Posted August 4, 2003 thanx alot I really appreciate you guys help. Quote Link to comment https://forums.phpfreaks.com/topic/821-phone-number-retrieval/#findComment-2743 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.