Ask a Question related to PHP Development, Design and Development.
-
bonehead #1
Ereg question
Greetings,
I'd like to add somee error handling to a password field: if the
password is fewer than 5 characters or greater than 15 characters I'd
like to trap it. Special characters such as ^ and ~ will be allowed, but
spaces will not be allowed.
Can someone suggest and ereg expression that will help with this? Also,
does php have a length function similar to vb's len(mystring)?
bonehead Guest
-
ereg problem
Can any of you kind people tell me what I'm doing wrong? An example: $code="<gateway>FooBar</gateway>"; $var="gateway"; I am trying to get... -
ereg
Hi! I'm working with ereg and mails now. Does represent only A-Z, 0-9 or something more? And if yes, ther what? TIA RuBenz -
[PHP] Bug in Ereg?
ow .. this script won't work .. checkboxes like this: <input type=checkbox name="colors" value="on"> or var calling like this: $_POST ... -
Bug in Ereg?
Hi, I have a form with checkboxes that POSTs to a PHP script. What is posted : _POST on _POST on _POST on -
simple ereg() question
Hi, How do i check with ereg() is a string is non-empty (!== '') Thx G -
Chung Leong #2
Re: Ereg question
Yup, regular expression is the perfect tool for this task. Try this:
echo preg_match('|^\\w{5,15}$|', $password) ? "Good" : "Bad";
Uzytkownik "bonehead" <sendmenospam@here.org> napisal w wiadomosci
news:3FD20296.1070008@here.org...> Greetings,
>
> I'd like to add somee error handling to a password field: if the
> password is fewer than 5 characters or greater than 15 characters I'd
> like to trap it. Special characters such as ^ and ~ will be allowed, but
> spaces will not be allowed.
>
> Can someone suggest and ereg expression that will help with this? Also,
> does php have a length function similar to vb's len(mystring)?
>
Chung Leong Guest
-
Tormod Fjeldskår #3
Re: Ereg question
bonehead wrote:
Sure: $length = strlen($mystring);> Also, does php have a length function similar to vb's len(mystring)?
<URL: http://no2.php.net/manual/en/function.strlen.php>
--
Tormod Fjeldskår
[email]tormod@fritidsproblemer.no[/email]
[url]http://tormod.fritidsproblemer.no/[/url]
Tormod Fjeldskår Guest
-
bonehead #4
Thanks Re: Ereg question
Chung I must say you've been very very helpful. Sure hope you're getting
paid enough. And are you actually fluent in Polish?
Chung Leong wrote:> Yup, regular expression is the perfect tool for this task. Try this:
>
> echo preg_match('|^\\w{5,15}$|', $password) ? "Good" : "Bad";
>
> Uzytkownik "bonehead" <sendmenospam@here.org> napisal w wiadomosci
> news:3FD20296.1070008@here.org...
>>>Greetings,
>>
>>I'd like to add somee error handling to a password field: if the
>>password is fewer than 5 characters or greater than 15 characters I'd
>>like to trap it. Special characters such as ^ and ~ will be allowed, but
>>spaces will not be allowed.
>>
>>Can someone suggest and ereg expression that will help with this? Also,
>>does php have a length function similar to vb's len(mystring)?bonehead Guest
-
Chung Leong #5
Re: Thanks Re: Ereg question
I get paid well enough for someone who studies Polish :-)
Uzytkownik "bonehead" <sendmenospam@here.org> napisal w wiadomosci
news:3FD220FE.30500@here.org...> Chung I must say you've been very very helpful. Sure hope you're getting
> paid enough. And are you actually fluent in Polish?
>
> Chung Leong wrote:>> > Yup, regular expression is the perfect tool for this task. Try this:
> >
> > echo preg_match('|^\\w{5,15}$|', $password) ? "Good" : "Bad";
> >
> > Uzytkownik "bonehead" <sendmenospam@here.org> napisal w wiadomosci
> > news:3FD20296.1070008@here.org...
> >> >>Greetings,
> >>
> >>I'd like to add somee error handling to a password field: if the
> >>password is fewer than 5 characters or greater than 15 characters I'd
> >>like to trap it. Special characters such as ^ and ~ will be allowed, but
> >>spaces will not be allowed.
> >>
> >>Can someone suggest and ereg expression that will help with this? Also,
> >>does php have a length function similar to vb's len(mystring)?
Chung Leong Guest
-
Shawn Wilson #6
Re: Ereg question
bonehead wrote:
The preg functions are usually faster than the ereg. And strlen() will give you>
> Greetings,
>
> I'd like to add somee error handling to a password field: if the
> password is fewer than 5 characters or greater than 15 characters I'd
> like to trap it. Special characters such as ^ and ~ will be allowed, but
> spaces will not be allowed.
>
> Can someone suggest and ereg expression that will help with this? Also,
> does php have a length function similar to vb's len(mystring)?
the string length.
Shawn
--
Shawn Wilson
[email]shawn@glassgiant.com[/email]
[url]http://www.glassgiant.com[/url]
Shawn Wilson Guest



Reply With Quote

