Jump to content


Photo

Form Validation with Preg_Match getting an error at the end


  • Please log in to reply
6 replies to this topic

#1 kenwvs

kenwvs
  • Members
  • PipPipPip
  • Advanced Member
  • 194 posts

Posted 11 July 2006 - 11:58 PM

I have a validation script that I am trying to figure out and it looks like this:
if($error == "0"){
echo "
The data you entered was valid<p>

}else{
;echo "Number of errors: $error ";  //this is line 329
}
?>

and when I run it, I am getting this error

Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in C:\Documents and Settings\Owner\My Documents\My Webs\forsale4u\php90F.tmp on line 329



#2 play_

play_
  • Staff Alumni
  • Advanced Member
  • 717 posts

Posted 12 July 2006 - 12:00 AM

;echo "Number of errors: $error ";  //this is line 329

take out the ; before the echo
regex.kat.sh --- regex library
u.kat.sh ---- url shortener
tabbit.org ---- tabbed pastebin

#3 play_

play_
  • Staff Alumni
  • Advanced Member
  • 717 posts

Posted 12 July 2006 - 12:01 AM

wait hold on.


if($error == "0"){
echo "
The data you entered was valid<p>";

}else{
echo "Number of errors: $error ";  //this is line 329
}
?>

regex.kat.sh --- regex library
u.kat.sh ---- url shortener
tabbit.org ---- tabbed pastebin

#4 kenwvs

kenwvs
  • Members
  • PipPipPip
  • Advanced Member
  • 194 posts

Posted 12 July 2006 - 12:03 AM

Same error.  I put that in and forgot to take it out when I was trying to figure out what the problem was.  sorry about that.

Ken

#5 play_

play_
  • Staff Alumni
  • Advanced Member
  • 717 posts

Posted 12 July 2006 - 12:11 AM

so is it fixed?
regex.kat.sh --- regex library
u.kat.sh ---- url shortener
tabbit.org ---- tabbed pastebin

#6 kenwvs

kenwvs
  • Members
  • PipPipPip
  • Advanced Member
  • 194 posts

Posted 12 July 2006 - 12:15 AM

no.  With that removed you get the same error.  I was getting the error and then when trying to fix it, I accidentaly put that in and forgot to take it out.  So the error is still there when you remove it.

Ken

#7 kenwvs

kenwvs
  • Members
  • PipPipPip
  • Advanced Member
  • 194 posts

Posted 12 July 2006 - 12:22 AM

I copied and pasted the original lines from a starting script i found and there is no error, so we will see what happens when I make changes again.  Sorry about that.

Ken




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users