Go Back   Forum Care Forums > Development Reference Area > Php Development

Reply
 
LinkBack Thread Tools Display Modes
wierd slash
Old
  (#1)
Don
Guest
 
Posts: n/a
Default wierd slash - 05-14-2007, 03:36 AM

I have a line of code that validates form info for some POST vars, but not
others.







if (!ereg("^[A-Za-z' -]{1,50}$",$_POST[$field]) )





when I put O'Toole in the form to test, my script kicks the page back (I
thought this entry would be OK)



but moreover, when it redisplays the form and populates the new form with
the entries previously entered, O'Toole becomes O\



when I put similar entries into fields that are not run through this line,
they go to the DB as typed.



Any advice?



Thanks again



Don




   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Re: [PHP] wierd slash
Old
  (#2)
Roman Neuhauser
Guest
 
Posts: n/a
Default Re: [PHP] wierd slash - 05-14-2007, 03:36 AM

# EMAIL REMOVED / 2007-01-20 21:50:48 -0700:
> I have a line of code that validates form info for some POST vars, but not
> others.
>
> if (!ereg("^[A-Za-z' -]{1,50}$",$_POST[$field]) )
>
> when I put O'Toole in the form to test, my script kicks the page back (I
> thought this entry would be OK)
>
> but moreover, when it redisplays the form and populates the new form with
> the entries previously entered, O'Toole becomes O\


magic_quotes_gpc?

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
RE: [PHP] wierd slash
Old
  (#3)
Don
Guest
 
Posts: n/a
Default RE: [PHP] wierd slash - 05-14-2007, 03:36 AM

magic_quotes_gpc On On
magic_quotes_runtime Off Off
magic_quotes_sybase Off Off

but I know if I can change that

is there some other way to fix this problem?

Don



# EMAIL REMOVED / 2007-01-20 21:50:48 -0700:
> I have a line of code that validates form info for some POST vars, but not
> others.
>
> if (!ereg("^[A-Za-z' -]{1,50}$",$_POST[$field]) )
>
> when I put O'Toole in the form to test, my script kicks the page back (I
> thought this entry would be OK)
>
> but moreover, when it redisplays the form and populates the new form with
> the entries previously entered, O'Toole becomes O\


magic_quotes_gpc?

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: [PHP] wierd slash
Old
  (#4)
Jim Lucas
Guest
 
Posts: n/a
Default Re: [PHP] wierd slash - 05-14-2007, 03:36 AM

Don wrote:
> magic_quotes_gpc On On
> magic_quotes_runtime Off Off
> magic_quotes_sybase Off Off
>
> but I know if I can change that
>
> is there some other way to fix this problem?
>
> Don
>
>
>
> # EMAIL REMOVED / 2007-01-20 21:50:48 -0700:
>> I have a line of code that validates form info for some POST vars, but not
>> others.
>>
>> if (!ereg("^[A-Za-z' -]{1,50}$",$_POST[$field]) )
>>
>> when I put O'Toole in the form to test, my script kicks the page back (I
>> thought this entry would be OK)
>>
>> but moreover, when it redisplays the form and populates the new form with
>> the entries previously entered, O'Toole becomes O\

>
> magic_quotes_gpc?
>

stripslashes() ?
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On





Contact Us - Forum Care Forums - Archive - Top