Jump to content

[SOLVED] Lowercase only


NoDoze

Recommended Posts

Hmmmm....ok.... I think I'm closer, but still don't understand....

 

This is from my code:

$user_id = $_POST['user_id'];

 

How would I apply this to it?

$string = "This-Is An! Example234";

$string = preg_replace('/[^0-9a-z]*/','',strtolower($string));

 

Would it be...?

$user_id = preg_replace('/[^a-z]*/','',strtolower($_POST['user_id']));

 

Thanks!

 

What do you mean?  My code does use $_POST.  This code is assuming the user hits 'submit' and the form is submitted to the processing page/script.  With $_POST all you do is call the name of the input field.  So if you have:

 


 

Then you would get the submitted information by calling...

 

$user_id = $_POST['NoDoze'];

 

Is this what you're asking or helpful?

 

 

Worked perfectly!

 

But now I realize I have another problem... the same variable is creating the user folder too!

 

So...

mkdir ("/home/dir/dir/ftp/{$_POST['user_id']}")

is creating the directory with the mixed caps.

 

how would I alter this to take lowercase only?

mkdir ("/home/dir/dir/ftp/$user_id")

So that it would take the defined variable from above instead in lowercase?

 

Thanks

 

 

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.