Re: [PHP] strlower problem

2008-06-02 Thread Ted Wood


On 2-Jun-08, at 10:25 AM, Ed Curtis wrote:


I found the problem myself. The actual code follows the same  
principal but the value of $thisStr is a $_GET value from a link.  
The name of that value in the link was 'style'. Oops, you should  
never use a HTML reserved attribute as a varible identifier in a  
link. I just wasn't thinking at the time I wrote it. (href="order2.php"?style="CL22">)


Input validation is always a very important aspect when using values  
submitted by the client.
Assuming that $_GET['style'] existed without testing for it was the  
first thing that should've been looked at.


In order to make maximum use of this mailing list, it's really helpful  
for us to see the _actual_ code you're using, rather than fake code.  
Your fake code had no problems, so we weren't able to provide you with  
a solution, but it sounds like your real code had the error that  
caused the problem.


Even in your latest post, you put this:
()

What's with all of those double-quotes? More fake code, or is that  
actually what you have in your code?



~Ted

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] strlower problem

2008-06-02 Thread Ed Curtis

Michael Kubler wrote:

Does :

/echo strtolower("CL22");/

work?
You could also try :

/var_dump($strLow);

/

Ed Curtis wrote:

Richard Heyes wrote:

Ed Curtis wrote:
I'm converting upper case characters in a string to lower case and 
am coming up with an empty string.


As I've done a million times before with other non-numerical strings.

$thisStr = "CL22";

$strLow = strtolower($thisStr);

echo $thisStr;

Why does $strLow come up empty?
My mistake. I meant to type echo $strLow; not echo $thisStr; in my 
post.




I found the problem myself. The actual code follows the same principal 
but the value of $thisStr is a $_GET value from a link. The name of that 
value in the link was 'style'. Oops, you should never use a HTML 
reserved attribute as a varible identifier in a link. I just wasn't 
thinking at the time I wrote it. ()


Sorry I took up your time,

Ed 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] strlower problem

2008-06-02 Thread Michael Kubler

Does :

/echo strtolower("CL22");/

work?
You could also try :

/var_dump($strLow);

/

Ed Curtis wrote:

Richard Heyes wrote:

Ed Curtis wrote:
I'm converting upper case characters in a string to lower case and 
am coming up with an empty string.


As I've done a million times before with other non-numerical strings.

$thisStr = "CL22";

$strLow = strtolower($thisStr);

echo $thisStr;

Why does $strLow come up empty?

My mistake. I meant to type echo $strLow; not echo $thisStr; in my post.




Re: [PHP] strlower problem

2008-06-02 Thread Ed Curtis

Richard Heyes wrote:

Ed Curtis wrote:
I'm converting upper case characters in a string to lower case and am 
coming up with an empty string.


As I've done a million times before with other non-numerical strings.

$thisStr = "CL22";

$strLow = strtolower($thisStr);

echo $thisStr;

Why does $strLow come up empty?


Because you're echoing out the original (uppercase) string. Try:

echo $strLow;



My mistake. I meant to type echo $strLow; not echo $thisStr; in my post.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] strlower problem

2008-06-02 Thread Jim Lucas

Richard Heyes wrote:

Ed Curtis wrote:
I'm converting upper case characters in a string to lower case and am 
coming up with an empty string.


As I've done a million times before with other non-numerical strings.

$thisStr = "CL22";

$strLow = strtolower($thisStr);

echo $thisStr;

Why does $strLow come up empty?


Because you're echoing out the original (uppercase) string. Try:

echo $strLow;


//in my best yoda voice//

to quickly you answer before you think...

//back in the Milky Way...//

he should still see something.

the op should see the original string 'CL22'.  Last time I looked strtolower() 
did not modify the input as a reference.


So   echo $thisStr; should result in the op seeing CL22

Unless there are other things happening that only the force knows about...

--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] strlower problem

2008-06-02 Thread Richard Heyes

Ed Curtis wrote:
I'm converting upper case characters in a string to lower case and am 
coming up with an empty string.


As I've done a million times before with other non-numerical strings.

$thisStr = "CL22";

$strLow = strtolower($thisStr);

echo $thisStr;

Why does $strLow come up empty?


Because you're echoing out the original (uppercase) string. Try:

echo $strLow;

--
  Richard Heyes

 In Cambridge? Employ me
http://www.phpguru.org/cv

++
| Access SSH with a Windows mapped drive |
|http://www.phpguru.org/sftpdrive|
++

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] strlower problem

2008-06-02 Thread Ed Curtis
I'm converting upper case characters in a string to lower case and am 
coming up with an empty string.


As I've done a million times before with other non-numerical strings.

$thisStr = "CL22";

$strLow = strtolower($thisStr);

echo $thisStr;

Why does $strLow come up empty?

Thanks,

Ed



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php