l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2003 Jan 06 16:04

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] php and forms question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] php and forms question

On Mon, Jan 06, 2003 at 02:54:44PM -0800, Peter Jay Salzman wrote:
> there's a page i've been tinkering with, off and on, to teach myself
> php.  it's a cryptogram page:
> http://www.dirac.org/p/crypto/index.php
> i have some data that i pass using hidden form fields, like this:
> print "<FORM action=\"index.php\" method=\"post\">\n";
> print "<INPUT type=\"hidden\" name=\"PlainText\" value=\"$PlainText\">\n";
> print "<INPUT type=\"hidden\" name=\"CipherText\" value=\"$CipherText\">\n";
> when the user presses the submit button, any apostrophes or backslashes
> within $PlainText or $CipherText get backslashed.   Like this:

> and so on.  i'm not sure why or how the backslashes are entering the
> string.  without really knowing why this is happening, i tried to remove
> the symptom by brute force:

They are in the string because you probably have something in your
php.ini like:
magic_quotes_gpc = On

That tells PHP to escape quotes and backslashes for (G)et (P)ost and
(C)ookies.  Personally, I leave that setting off -- "don't mess with my
data unless I tell you to!"

Mr. Crawford mentioned the stripslashes() function, and I'd highly
recommend glancing through the function definitions in the PHP manual,
especially those for strings and arrays.  I think you'll be surprised at
how many common tasks are already implemented.  

> i'm kind of lost.  any ideas?

Yeah, RTFM, you evil spammer.


vox-tech mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Sunset Systems
Who graciously hosts our website & mailing lists!