jodnls Posted June 12, 2009 Share Posted June 12, 2009 Hi, I have a form that asks for the company name. I want php to see it as one word (the Union -- theunion) when inserting it to the database and also to make a new directory. This is what I have now: $query = "INSERT INTO Accounts(business,firstname,lastname,email,contact phone,streetaddress,city,state,zip,country,website ,style,font) VALUES('".$_POST["b_name"]."','".$_POST["f_name"]."','".$_POST["l_name"]."','".$_POST["email"]."','".$_POST["phoneNo"]."','".$_POST["street"]."','".$_POST["city"]."','".$_POST["state"]."','".$_POST["zip"]."','".$_POST["country"]."','".$_POST["website"]."','".$_POST["style"]."','".$_POST["font"]."')"; and $newdir = $_POST["business"]; mkdir("./$newdir", 0755); I just don't know how to make it skip the spaces in the form answers. I have been searching all over for answers. I appreciate any help I can get. Thanks Link to comment https://forums.phpfreaks.com/topic/161986-ignore-form-spaces/ Share on other sites More sharing options...
jpratt Posted June 12, 2009 Share Posted June 12, 2009 $newdir = str_replace (" ", "", $_POST['business']); Link to comment https://forums.phpfreaks.com/topic/161986-ignore-form-spaces/#findComment-854688 Share on other sites More sharing options...
jodnls Posted June 12, 2009 Author Share Posted June 12, 2009 Thanks so much for the help. Can I now make $newdir all lowercase characters? Link to comment https://forums.phpfreaks.com/topic/161986-ignore-form-spaces/#findComment-854755 Share on other sites More sharing options...
.josh Posted June 12, 2009 Share Posted June 12, 2009 strtolower Link to comment https://forums.phpfreaks.com/topic/161986-ignore-form-spaces/#findComment-854759 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.