REGISTER
|
Search Tycoon Talk
|
Freelancer.com
|
Members
Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.
Register Here
Forum Rules
PHP Forum
You are currently viewing our PHP Forum as a guest. Please
register
to participate.
Login
Remember Me?
Login via Freelancer.com
Tycoon Talk
>
Web Development and Programming Support
>
PHP Forum
>
Why do I get REG_BADBR
Link Back
Thread Tools
Search this Thread
Why do I get REG_BADBR
10-04-2007, 09:50 PM
#
1
(
permalink
)
Why do I get REG_BADBR
scrobins
Skilled Talker
Posts: 50
Name: Stuart Robinson
Location: Busselton
Trades:
0
Talkupation:
I am trying to match this pattern using this code;
PHP Code:
if(!
ereg
(
"^[A-Za-z -]{1-50}$"
,
$_POST
[
'$field'
])) {
but keep coming up with the error ;
Warning
: ereg() [
function.ereg
]: REG_BADBR in
What am I doing wrong?
BTW - I'm using PHP 5.2.3
Register
now for full access!
10-04-2007, 10:31 PM
#
2
(
permalink
)
Re: Why do I get REG_BADBR
TwistMyArm
Ultra Talker
Posts: 483
Trades:
0
Talkupation:
What if you tried:
if(!ereg("^[A-Za-z \-]{1-50}$",$_POST['$field'])) {
ie. escape the lone dash in that first group?
__________________
Please login or register to view this content.
Registration is FREE
10-05-2007, 12:15 AM
#
3
(
permalink
)
Re: Why do I get REG_BADBR
scrobins
Skilled Talker
Posts: 50
Name: Stuart Robinson
Location: Busselton
Trades:
0
Talkupation:
Nup. No joy with this either.
Could there be some problem with PHP dealing with the closing $ delimiter?
If so, is there another possible work around to deal with this issue?
10-05-2007, 07:32 AM
#
4
(
permalink
)
Re: Why do I get REG_BADBR
TwistMyArm
Ultra Talker
Posts: 483
Trades:
0
Talkupation:
That definitely could be a problem
Instead of using double quotes use single quotes. That will stop the PHP interpreter trying to parse variables in the string.
__________________
Please login or register to view this content.
Registration is FREE
10-05-2007, 09:08 AM
#
5
(
permalink
)
Re: Why do I get REG_BADBR
scrobins
Skilled Talker
Posts: 50
Name: Stuart Robinson
Location: Busselton
Trades:
0
Talkupation:
Yer, tried it already but no joy there either. I've removed the !ereg() and just used it as ereg() and it seems to work but not as succinctly.
Cheers for your help TwistMyArm.
« Reply to
Why do I get REG_BADBR
Previous Thread
|
Next Thread
Tycoon Talk
>
Web Development and Programming Support
>
PHP Forum
>
Why do I get REG_BADBR
Thread Tools
Search this Thread
Show Printable Version
Email this Page
Search this Thread
:
Advanced Search
Posting Rules
You
may not
post new threads
You
may not
post replies
You
may not
post attachments
You
may not
edit your posts
BB code
is
On
Smilies
are
On
[IMG]
code is
On
HTML code is
Off
Trackbacks
are
Off
Pingbacks
are
Off
Refbacks
are
Off
Forum Rules
Feeds:
RSS
JS
XML
Feeds for this forum:
RSS
JS
XML
LinkBack
LinkBack URL
About LinkBacks
Bookmark & Share
Digg this Thread!
Add Thread to del.icio.us
Bookmark in Technorati
Tweet this thread
Page generated in
0.25999
seconds with
12
queries