Closed Thread Icon

Topic awaiting preservation: PHP problems with interoreting $ sign as a siring character Pages that link to <a href="https://ozoneasylum.com/backlink?for=23264" title="Pages that link to Topic awaiting preservation: PHP problems with interoreting $ sign as a siring  character" rel="nofollow" >Topic awaiting preservation: PHP problems with interoreting $ sign as a siring  character\

 
Author Thread
paritycheck
Bipolar (III) Inmate

From:
Insane since: Mar 2004

posted posted 09-11-2004 10:57

I'm passing variables from one form to a php page. At times a user may enter the $ sign in the textboxes on the form but when it gets to the php page its interpolated as a variable instead of a character in a string. What string function do I use to ensure that the contents being posted from my form are ALL interpreted as characters.

Any help

Skaarjj
Maniac (V) Mad Scientist

From: :morF
Insane since: May 2000

posted posted 09-11-2004 13:17

run your string through a str_replace() function, searching for $ and replacing it with \$

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 09-11-2004 14:20

may I inquire what are you doing with the form data? calling eval on it?

so long,

->Tyberius Prime

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 09-11-2004 15:44

That is the only way I could see the data being interpereted as a real variable. You should never call eval on user submitted data, especially if you don't know how to make sure that all of your data is valid.

Dan @ Code Town

« BackwardsOnwards »

Show Forum Drop Down Menu