PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
fastfingertips
Forum Contributor
Posts: 242 Joined: Sun Dec 28, 2003 1:40 am
Contact:
Post
by fastfingertips » Thu Jan 08, 2004 8:20 am
Code: Select all
<?php
var $emailpattern = "^[a-z0-9]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*.[a-z]{2,3}$";
?>
Error message:
Parse error: parse error, unexpected '\"' in engine.php on line 76
malcolmboston
DevNet Resident
Posts: 1826 Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK
Post
by malcolmboston » Thu Jan 08, 2004 8:21 am
you havent give us line 76
scorphus
Forum Regular
Posts: 589 Joined: Fri May 09, 2003 11:53 pm
Location: Belo Horizonte, Brazil
Contact:
Post
by scorphus » Thu Jan 08, 2004 8:23 am
Try this:
Code: Select all
<?php
var $emailpattern = "^[a-z0-9]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*.[a-z]{2,3}\$"; //...$" => ...\$"
?>
Cheers,
Scorphus.
fastfingertips
Forum Contributor
Posts: 242 Joined: Sun Dec 28, 2003 1:40 am
Contact:
Post
by fastfingertips » Thu Jan 08, 2004 8:27 am
That was the line 76
And indeed it needs that \.
Scorpus pleas enlighten me why that \ ?
malcolmboston
DevNet Resident
Posts: 1826 Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK
Post
by malcolmboston » Thu Jan 08, 2004 8:28 am
there isnt a \ in his code, so how is it finding that is the error?
you sure youve given us the correct line?
fastfingertips
Forum Contributor
Posts: 242 Joined: Sun Dec 28, 2003 1:40 am
Contact:
Post
by fastfingertips » Thu Jan 08, 2004 8:29 am
Yes because once i have modified my line according to scorpus recs now is working fine.
Scorpus please enlighten me why that \ ?
scorphus
Forum Regular
Posts: 589 Joined: Fri May 09, 2003 11:53 pm
Location: Belo Horizonte, Brazil
Contact:
Post
by scorphus » Thu Jan 08, 2004 8:36 am
Sure! I was editing this post
\ is the escape operator. See the
Strings section of the PHP Manual and also
string parsing for accurate further information and examples.
Cheers,
Scorphus.
fastfingertips
Forum Contributor
Posts: 242 Joined: Sun Dec 28, 2003 1:40 am
Contact:
Post
by fastfingertips » Thu Jan 08, 2004 8:47 am
Thank you
The pages were already printed (from manual) and now i'm studying them
I have passed some things and now i see the results