[PHP] why doesn't default values for this function work - resending because of bad formatting

2003-08-14 Thread anders thoresson
Hi, I'm having problem with a function that I'll use to validate user input before passing it to MySQL. For strings, I want to make sure that they aren't to long, so I have written this function: function secure_string($unsafe_string, $max_length = -1, $errormessage = Too many characters. ) {

[PHP] why doesn't default values for this function work

2003-08-11 Thread anders thoresson
Hi, I'm having problem with a function that I'll use to validate user input before passing it to MySQL. For strings, I want to make sure that they aren't to long, so I have written this function: function secure_string($unsafe_string, $max_length = -1, $errormessage = Too many characters. )

Re: [PHP] why doesn't default values for this function work - resending because of bad formatting

2003-08-06 Thread anders thoresson
What is this mess that you have here :-) I don't have a clue! :) It looks allright here, when I press send. How exactly are you calling the function when no $max_length is passed? If you're doing something like: secure_string($string, '', 'error msg'); Just secure_string($string);. In that

Re: [PHP] why doesn't default values for this function work - resending because of bad formatting

2003-08-06 Thread Jason Wong
On Wednesday 06 August 2003 01:06, anders thoresson wrote: I'm having problem with a function that I'll use to validate user input before passing it to MySQL. For strings, I want to make sure that they aren't to long, so I have written this function: What is this mess that you have here :-)