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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.