Jump to content

Recommended Posts

Hi All,

 

My question is pretty basic, how do I use ucfirst when submitting a form to the Table?

 

I have tried the following:

 

,'$_POST ucfirst[fname] $_POST ucfirst[lname]'

 

And

 

,'$_POST [ucfirst(fname)] $_POST [ucfirst(lname)]'

 

Thanks

The code you have posted makes no sense.

 

You pass your values to ucfirst as an argument. eg;

 

ucfirst($_POST['fname']);

 

Having said that, why are you modifying user submitted data? And secondly, your not using user submitted data directory in your queries are you?

Sorry I probably should of also mentioned that the code I posted is part of the SQL Query where I am doing a

 

INSERT INTO
VALUES ('$_POST ucfirst[fname] $_POST ucfirst[lname]')

 

Hence why the code looks the way it does

What everyone is getting as is that you should not modify the information before you put it in the database.  Although, you DO need to sanitize it before hand.

 

Wait until you take the information out from the database to modify its look and feel.  Otherwise, it would be like pouring milk into a cereal box, and then putting it in the cabinet so you don?t have to add milk later.  Be normal and pour the milk in afterwards.

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.