Jump to content

ignore form spaces


jodnls

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.