473,326 Members | 2,128 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

i\'m or i\'d

SOR
Although its i'm or i'd thats get typed into a form a slash appears when
the typed in text is viewed later .

Not a hard problem to fix - but why does it happen .
Jul 26 '05 #1
8 1210
SOR wrote:
Although its i'm or i'd thats get typed into a form a slash appears when
the typed in text is viewed later .

Not a hard problem to fix - but why does it happen .


Magic Quotes
http://docs.php.net/en/security.magicquotes.html
Jul 26 '05 #2
SOR
<comp.lang.php , jamen , jamen@invalid>
<42*********************@dtext02.news.tele.dk>
<Wed, 27 Jul 2005 00:01:43 +0200>
Although its i'm or i'd thats get typed into a form a slash appears when
the typed in text is viewed later .

Not a hard problem to fix - but why does it happen .


Magic Quotes
http://docs.php.net/en/security.magicquotes.html


Thanks for that , Glad magic quotes where switched on or it probably
would have been the first bug report in a few days times when I make a
script public .

Seem to recall a while ago some geeks on another newsgroup saying magic
quotes was a bad thing though .
Jul 26 '05 #3

"SOR" <we*******@sparesorrepair.co.uk.INVALID> wrote in message
news:MP************************@no-cancel.newsreader.com...
<comp.lang.php , jamen , jamen@invalid>
<42*********************@dtext02.news.tele.dk>
<Wed, 27 Jul 2005 00:01:43 +0200>
> Although its i'm or i'd thats get typed into a form a slash appears
> when
> the typed in text is viewed later .
>
> Not a hard problem to fix - but why does it happen .


Magic Quotes
http://docs.php.net/en/security.magicquotes.html


Thanks for that , Glad magic quotes where switched on or it probably
would have been the first bug report in a few days times when I make a
script public .

Seem to recall a while ago some geeks on another newsgroup saying magic
quotes was a bad thing though .


It can be if you write a script in an environment where it is turned on,
then try to run it in another environment where it is turned off. Ideally
you should write code which can detect whether it is ON or OFF and deal with
it as appropriate, such as:

if (!get_magic_quotes_gpc()) {
$lastname = addslashes($_POST['lastname']);
} else {
$lastname = $_POST['lastname'];
} // if
--
Tony Marston

http://www.tonymarston.net

Jul 27 '05 #4
Rob
Tony Marston wrote:
"SOR" <we*******@sparesorrepair.co.uk.INVALID> wrote in message
news:MP************************@no-cancel.newsreader.com...
<comp.lang.php , jamen , jamen@invalid>
<42*********************@dtext02.news.tele.dk>
<Wed, 27 Jul 2005 00:01:43 +0200>
Although its i'm or i'd thats get typed into a form a slash appears
when
the typed in text is viewed later .

Not a hard problem to fix - but why does it happen .

Magic Quotes
http://docs.php.net/en/security.magicquotes.html


Thanks for that , Glad magic quotes where switched on or it probably
would have been the first bug report in a few days times when I make a
script public .

Seem to recall a while ago some geeks on another newsgroup saying magic
quotes was a bad thing though .

It can be if you write a script in an environment where it is turned on,
then try to run it in another environment where it is turned off. Ideally
you should write code which can detect whether it is ON or OFF and deal with
it as appropriate, such as:

if (!get_magic_quotes_gpc()) {
$lastname = addslashes($_POST['lastname']);
} else {
$lastname = $_POST['lastname'];
} // if

you could also write a couple of small functions containing the above

function prepare_input($string)
{
if (!get_magic_quotes_gpc())
{
return addslashes($string);
}
else
{
return $string;
}
}
function prepare_output($string)
{
if (!get_magic_quotes_gpc())
{
return stripslashes($string);
}
else
{
return $string;
}
}

$lastname = prepare_input($_POST['lastname']);
print(prepare_output($lastname));
Jul 27 '05 #5
SOR
<comp.lang.php , Tony Marston , to**@NOSPAM.demon.co.uk>
<dc*******************@news.demon.co.uk>
<Wed, 27 Jul 2005 10:03:28 +0100>
Thanks for that , Glad magic quotes where switched on or it probably
would have been the first bug report in a few days times when I make a
script public .

Seem to recall a while ago some geeks on another newsgroup saying magic
quotes was a bad thing though .


It can be if you write a script in an environment where it is turned on,
then try to run it in another environment where it is turned off. Ideally
you should write code which can detect whether it is ON or OFF and deal with
it as appropriate, such as:

if (!get_magic_quotes_gpc()) {
$lastname = addslashes($_POST['lastname']);
} else {
$lastname = $_POST['lastname'];
} // if


Saved to disk .

At the risk of being pointed to www.php.net by andy - would you have a
similar code snippet to check and see if globals is switched on .
Jul 27 '05 #6

"SOR" <we*******@sparesorrepair.co.uk.INVALID> wrote in message
news:MP************************@no-cancel.newsreader.com...
<comp.lang.php , Tony Marston , to**@NOSPAM.demon.co.uk>
<dc*******************@news.demon.co.uk>
<Wed, 27 Jul 2005 10:03:28 +0100>
> Thanks for that , Glad magic quotes where switched on or it probably
> would have been the first bug report in a few days times when I make a
> script public .
>
> Seem to recall a while ago some geeks on another newsgroup saying magic
> quotes was a bad thing though .


It can be if you write a script in an environment where it is turned on,
then try to run it in another environment where it is turned off. Ideally
you should write code which can detect whether it is ON or OFF and deal
with
it as appropriate, such as:

if (!get_magic_quotes_gpc()) {
$lastname = addslashes($_POST['lastname']);
} else {
$lastname = $_POST['lastname'];
} // if


Saved to disk .

At the risk of being pointed to www.php.net by andy - would you have a
similar code snippet to check and see if globals is switched on .


RTFM at http://uk2.php.net/ini_get

--
Tony Marston

http://www.tonymarston.net

Jul 28 '05 #7
SOR
<comp.lang.php , Tony Marston , to**@NOSPAM.demon.co.uk>
<dc*******************@news.demon.co.uk>
<Thu, 28 Jul 2005 10:03:14 +0100>
Saved to disk .

At the risk of being pointed to www.php.net by andy - would you have a
similar code snippet to check and see if globals is switched on .


RTFM at http://uk2.php.net/ini_get


Nice one .
Jul 28 '05 #8
In article <dc**********@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com>,
Rob <us**@domain.invalid> wrote:
Tony Marston wrote:
"SOR" <we*******@sparesorrepair.co.uk.INVALID> wrote in message
news:MP************************@no-cancel.newsreader.com...
<comp.lang.php , jamen , jamen@invalid>
<42*********************@dtext02.news.tele.dk>
<Wed, 27 Jul 2005 00:01:43 +0200>

>Although its i'm or i'd thats get typed into a form a slash appears
>when
>the typed in text is viewed later .
>
>Not a hard problem to fix - but why does it happen .

Magic Quotes
http://docs.php.net/en/security.magicquotes.html
Thanks for that , Glad magic quotes where switched on or it probably
would have been the first bug report in a few days times when I make a
script public .

Seem to recall a while ago some geeks on another newsgroup saying magic
quotes was a bad thing though .

It can be if you write a script in an environment where it is turned on,
then try to run it in another environment where it is turned off. Ideally
you should write code which can detect whether it is ON or OFF and deal
with
it as appropriate, such as:

if (!get_magic_quotes_gpc()) {
$lastname = addslashes($_POST['lastname']);
} else {
$lastname = $_POST['lastname'];
} // if

you could also write a couple of small functions containing the above

function prepare_input($string)
{
if (!get_magic_quotes_gpc())
{
return addslashes($string);
}
else
{
return $string;
}
}
function prepare_output($string)
{
if (!get_magic_quotes_gpc())
{
return stripslashes($string);
}
else
{
return $string;
}
}

$lastname = prepare_input($_POST['lastname']);
print(prepare_output($lastname));

It's a start.

Make use of this stuff:

Explanation: http://amduus.com/phpezine/archive/Issue2.pdf

Code: http://amduus.com/phpezine/archive/issue2.zip
--
Available for Hire! http://amduus.com/Resumes/
Aug 1 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

25
by: Andreas Fromm | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, Im building an user database with many tables keeping the data for the Address, Phone numbers, etc which are referenced by a table where I...
8
by: Roman | last post by:
Hello i got this simple problem using nhibernate. I want to chang the id( primary key of the) object and update it, to change this key. i me getting nhibernate exception like this: identifier...
6
by: plemon | last post by:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta...
3
by: scripter199 | last post by:
Hi, Im adding textboxes dynamically from an onclick event that calls the function below: function addRowDynamic() { rowCnt++; lookupCnt++; id++; //add a row to the rows...
1
by: Imran | last post by:
Hi Friends Salaam Namasteh, This is Muhammed Junaid Imran ..... Due to some technical problems am not able to login my Y! IM id i.e,. < mji_junaid and < mji_imms and for which i am...
3
by: RJReelar | last post by:
okay, im really not sure what to do here, as I've done the same thing before and it's worked perfectly but now ive tried to do the same thing again for another website and it's just not working... ...
5
by: Claire | last post by:
Hi, I can imagine this question has been brought up before but I've spent all morning trying to find what I need on google without success. My application sits on Mysql or MS sql server engines...
4
by: znyder | last post by:
Hi, First, Im really new in access and all I can say is this site is such a help.. Learn so much.. but still I have this problem. Im working on Access 2007, my problem is I want to print a...
0
by: maffarazo | last post by:
Hi! Im currenty using a repeater to loop out all my data in my database and everything is working just great =) I just have a small problem. how do I get wich id the item is from the database?...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.