Re: [PHP] escape \n

2010-04-23 Thread Lupus Michaelis
Le 23/04/2010 10:05, Ashley Sheridan a écrit : By default, PHP sends out HTML headers. Browsers ignore extraneous white-space characters, and also new lines, carriage returns and tabs, converting them all to a single space character. For completeness, the white-space discarding depends about

Re: [PHP] escape \n

2010-04-23 Thread Jan G.B.
You can also just send out the correct Header for plain text. But your HTMl will not be interpreted then.. So this makes only sense if you actually want plain text as the output format. header("Content-type: text/plain; charset=utf8"); echo "foo\nbar"; Regards 2010/4/23 Nick Balestra : > Thanks

Re: [PHP] escape \n

2010-04-23 Thread Nick Balestra
Thanks everybody! On Apr 23, 2010, at 10:05 AM, Ashley Sheridan wrote: > On Fri, 2010-04-23 at 09:51 +0200, Nick Balestra wrote: >> >> Hello guys i am trying to figure out what is worng with thoose special >> escaped character, like \n \t \r ... >> >> As i cannot make them working. The browser

Re: [PHP] escape \n

2010-04-23 Thread Ashley Sheridan
On Fri, 2010-04-23 at 09:51 +0200, Nick Balestra wrote: > Hello guys i am trying to figure out what is worng with thoose special > escaped character, like \n \t \r ... > > As i cannot make them working. The browser doesn't display them, but doesn't > eithr crate a new line, or else. > I am usin

[PHP] escape \n

2010-04-23 Thread Nick Balestra
Hello guys i am trying to figure out what is worng with thoose special escaped character, like \n \t \r ... As i cannot make them working. The browser doesn't display them, but doesn't eithr crate a new line, or else. I am using them fro example like this: print: "this shoudl be on a line \nwhi

Re: [PHP] escape your variables

2009-04-21 Thread Jan G.B.
2009/4/21 Chris : > How does one deal with that? Do you use mysql_real_escape_string? e.g. >>> $db_host = 'localhost'; $db_user = 'auser'; $db_pwd = 'apassword'; $database = 'adatabase'; $table = 'authorBook'; if (!mysql_connect($db_host, $db_user,

Re: [PHP] escape your variables

2009-04-20 Thread Chris
How does one deal with that? Do you use mysql_real_escape_string? e.g. Inputs are user supplied. Are you saying that I don't need to sanitize the variables above - $db_host, $db_user, $db_pwd, $database, $table ? No - they are essentially hardcoded. A user (through a form or any other

Re: [PHP] escape your variables

2009-04-20 Thread PJ
Bastien Koert wrote: > On Wed, Feb 18, 2009 at 8:34 AM, PJ wrote: > > >> To focus on mysql_real_escape_string, I am recapping... questions below >> QUOTE:== >> Instead of doing this (for an imaginary table): >> $sql = "insert into table1(field1, field2) values ('$value1', '$value2')"; >

Re: [PHP] Escape Data In/Out of db [solved]

2009-04-11 Thread Shawn McKenzie
Shawn McKenzie wrote: > tedd wrote: >>> I think you want to look for magic_quotes_gpc >>> >>> >>> -- >>> Thanks! >>> -Shawn >> >> -Shawn: >> >> You were right. >> >> I'll fix it. >> >> Thanks, >> >> tedd > > I normally have a prep4display() and prep4store() type function that do > all of the sens

Re: [PHP] Escape Data In/Out of db [solved]

2009-04-11 Thread Shawn McKenzie
tedd wrote: >> I think you want to look for magic_quotes_gpc >> >> >> -- >> Thanks! >> -Shawn > > > -Shawn: > > You were right. > > I'll fix it. > > Thanks, > > tedd I normally have a prep4display() and prep4store() type function that do all of the sensitization/prep for either storing or display

Re: [PHP] Escape Data In/Out of db [solved]

2009-04-11 Thread Shawn McKenzie
tedd wrote: > At 9:12 PM -0700 4/9/09, Jim Lucas wrote: >> tedd wrote: >>> At 5:03 PM +0200 4/9/09, Jan G.B. wrote: You might want to use htmlspecialchars($str, ENT_QUOTES) >>> >>> OUT from db to html >>> >>> and >>> mysql_real_escape_string(stripslashes($_POST['yourself'])); >>> >>

Re: [PHP] Escape Data In/Out of db [solved]

2009-04-10 Thread tedd
At 9:12 PM -0700 4/9/09, Jim Lucas wrote: tedd wrote: At 5:03 PM +0200 4/9/09, Jan G.B. wrote: You might want to use htmlspecialchars($str, ENT_QUOTES) OUT from db to html and mysql_real_escape_string(stripslashes($_POST['yourself'])); The above tells me that you probably need to look

Re: [PHP] Escape Data In/Out of db [solved]

2009-04-09 Thread Jim Lucas
tedd wrote: At 5:03 PM +0200 4/9/09, Jan G.B. wrote: You might want to use htmlspecialchars($str, ENT_QUOTES) OUT from db to html and mysql_real_escape_string(stripslashes($_POST['yourself'])); The above tells me that you probably need to look at your magic quotes setting. Typically,

Re: [PHP] Escape Data In/Out of db [solved]

2009-04-09 Thread tedd
At 5:03 PM +0200 4/9/09, Jan G.B. wrote: You might want to use htmlspecialchars($str, ENT_QUOTES) OUT from db to html and mysql_real_escape_string(stripslashes($_POST['yourself'])); IN to db from html Thanks, that worked. Cheers, tedd -- --- http://sperling.com http://ancientst

Re: [PHP] Escape Data In/Out of db

2009-04-09 Thread Jan G.B.
2009/4/9 tedd : > Hi gang: -.- > > I'm gathering information from a user, storing that data in a db, and then > showing it back to the user. It's a simple process and can bee seen here in > this address book demo (not real people): > > http://php1.net/a/edit-db-demo > > I gather information from

[PHP] Escape Data In/Out of db

2009-04-09 Thread tedd
Hi gang: I'm gathering information from a user, storing that data in a db, and then showing it back to the user. It's a simple process and can bee seen here in this address book demo (not real people): http://php1.net/a/edit-db-demo I gather information from the user via a $_POST[]; like thi

Re: [PHP] escape your variables

2009-03-04 Thread Chris
Actually no; you said "You only need to escape data coming from a user going in to your database." Using a known variable in my app is not going to cause an sql injection problem. switch ($value) { case 'x': $my_field = 1; break; default: $my_field = 0; } an insert here with

Re: [PHP] escape your variables

2009-03-04 Thread Michael A. Peters
Kyle Terry wrote: On Wed, Mar 4, 2009 at 6:55 PM, Chris wrote: Eric Butera wrote: On Wed, Mar 4, 2009 at 8:18 PM, Chris wrote: You only need to escape data coming from a user going in to your database. If you put user input into your database and pull it back out, it's still raw user in

Re: [PHP] escape your variables

2009-03-04 Thread Kyle Terry
On Wed, Mar 4, 2009 at 6:55 PM, Chris wrote: > Eric Butera wrote: > >> On Wed, Mar 4, 2009 at 8:18 PM, Chris wrote: >> >>> You only need to escape data coming from a user going in to your >>> database. >>> >> >> If you put user input into your database and pull it back out, it's >> still raw use

Re: [PHP] escape your variables

2009-03-04 Thread Chris
Eric Butera wrote: On Wed, Mar 4, 2009 at 8:18 PM, Chris wrote: You only need to escape data coming from a user going in to your database. If you put user input into your database and pull it back out, it's still raw user input. Never trust any piece of data ever, whether it comes from a sup

Re: [PHP] escape your variables

2009-03-04 Thread Kyle Terry
On Wed, Mar 4, 2009 at 6:27 PM, Eric Butera wrote: > On Wed, Mar 4, 2009 at 8:54 PM, Michael A. Peters wrote: > > Eric Butera wrote: > > > >> > >> So here's some examples of bad behavior. > >> > >> = Database = > >> Bad: > >> $name = mysql_real_escape_string($_POST['name'], $link); > >> myql_que

Re: [PHP] escape your variables

2009-03-04 Thread Eric Butera
On Wed, Mar 4, 2009 at 8:54 PM, Michael A. Peters wrote: > Eric Butera wrote: > >> >> So here's some examples of bad behavior. >> >> = Database = >> Bad: >> $name = mysql_real_escape_string($_POST['name'], $link); >> myql_query("INSERT INTO foo (`name`) VALUES ('". $name ."')"); >> >> $name now co

Re: [PHP] escape your variables

2009-03-04 Thread Eric Butera
On Wed, Mar 4, 2009 at 8:18 PM, Chris wrote: > You only need to escape data coming from a user going in to your database. If you put user input into your database and pull it back out, it's still raw user input. Never trust any piece of data ever, whether it comes from a superglobal OR within yo

Re: [PHP] escape your variables

2009-03-04 Thread Michael A. Peters
Eric Butera wrote: So here's some examples of bad behavior. = Database = Bad: $name = mysql_real_escape_string($_POST['name'], $link); myql_query("INSERT INTO foo (`name`) VALUES ('". $name ."')"); $name now contains slashes which means it is corrupt and not able to be echo'd without a strips

Re: [PHP] escape your variables

2009-03-04 Thread Chris
PJ wrote: Sorry, but I have been waylaid by other posts... :'( and have not had the opportunity to finish my quest and I posted to mysql but they are not very helpful I see I was not very clear below and will annotate below. But the problem is still there, I cannot figure out how to sanitize

Re: [PHP] escape your variables

2009-03-04 Thread Eric Butera
On Wed, Mar 4, 2009 at 8:04 PM, PJ wrote some stuff... You should do a little reading on some of the keywords that have been presented. Specifically you don't sanitize a value into your db. You escape it. Prepared statements are a way of doing this that makes it a bit harder to mess up. You ha

Re: [PHP] escape your variables

2009-03-04 Thread PJ
Sorry, but I have been waylaid by other posts... :'( and have not had the opportunity to finish my quest and I posted to mysql but they are not very helpful I see I was not very clear below and will annotate below. But the problem is still there, I cannot figure out how to sanitize with mysql_r

Re: [PHP] escape your variables

2009-02-18 Thread Eric Butera
On Wed, Feb 18, 2009 at 8:34 AM, PJ wrote: > To focus on mysql_real_escape_string, I am recapping... questions below > QUOTE:== > Instead of doing this (for an imaginary table): > $sql = "insert into table1(field1, field2) values ('$value1', '$value2')"; > > do > $sql = "insert into table1

Re: [PHP] escape your variables

2009-02-18 Thread Bastien Koert
On Wed, Feb 18, 2009 at 8:34 AM, PJ wrote: > To focus on mysql_real_escape_string, I am recapping... questions below > QUOTE:== > Instead of doing this (for an imaginary table): > $sql = "insert into table1(field1, field2) values ('$value1', '$value2')"; > > do > $sql = "insert into table

[PHP] escape your variables

2009-02-18 Thread PJ
To focus on mysql_real_escape_string, I am recapping... questions below QUOTE:== Instead of doing this (for an imaginary table): $sql = "insert into table1(field1, field2) values ('$value1', '$value2')"; do $sql = "insert into table1(field1, field2) values ('" . mysql_real_escape_string($v

Re: [PHP] escape character in query string

2008-06-26 Thread Thiago Melo de Paula
Hello Joaquin, use the urlencode function to "escape" the special characters. After, use urldecode to get the string back to normal. Regards, Thiago Melo de Paula On Sun, Jun 22, 2008 at 11:34 PM, joaquinbordado <[EMAIL PROTECTED]> wrote: > > would someone happen to know the escape character f

Re: [PHP] escape character in query string

2008-06-23 Thread James Dempster
for a space I belive a plus sign would work + try the urlencode function it would make it much easier. /James Dempster On Mon, Jun 23, 2008 at 3:34 AM, joaquinbordado <[EMAIL PROTECTED]> wrote: > > would someone happen to know the escape character for query string? > > here is my querysting my.p

RE: [PHP] escape character in query string

2008-06-23 Thread Chris Scott
%20 -Original Message- From: joaquinbordado [mailto:[EMAIL PROTECTED] Sent: Monday, June 23, 2008 3:35 AM To: php-general@lists.php.net Subject: [SPAM] [PHP] escape character in query string Importance: Low would someone happen to know the escape character for query string? here is my

[PHP] escape character in query string

2008-06-22 Thread joaquinbordado
would someone happen to know the escape character for query string? here is my querysting my.php?message=Hello%PHP%0AHow%was%your%day? the output should be Hello PHP How was your day? -- View this message in context: http://www.nabble.com/escape-character-in-query-string-tp18061596p1

Re: [PHP] Escape Chars for MS Exchange/Outlook

2006-07-20 Thread Stut
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mike wrote: > I am using Ubuntu 6.06 Linux with PHP 5.1.4. I am using the phpmailer class. > > I set the message body to be > > $msgbody = $msgbody.'\r\rDate: '.$_REQUEST['date'].'\rName: > '.$_REQUEST['lname'].', '.$_REQUEST['fname'].'\rReferral:

[PHP] Escape Chars for MS Exchange/Outlook

2006-07-20 Thread Mike
I am using Ubuntu 6.06 Linux with PHP 5.1.4. I am using the phpmailer class. I set the message body to be $msgbody = $msgbody.'\r\rDate: '.$_REQUEST['date'].'\rName: '.$_REQUEST['lname'].', '.$_REQUEST['fname'].'\rReferral: '.$_REQUEST['referral'].'\rTelephone: '.$_REQUEST['tele'].'\rLoan Offic

Re: [PHP] Escape problems...why?

2004-04-23 Thread Marek Kilimajer
Ryan A wrote: Hey John, Thanks for replying. I cant use strip slashes because there are a number of scripts doing DB things and searching for all of them and modifying things just for one client can be a royal PITA. I tried to use "php_flag magic_quotes_gpc off" in the *existing* .htaccess file lik

Re: [PHP] Escape problems...why?

2004-04-23 Thread Jason Wong
On Friday 23 April 2004 12:21, Ryan A wrote: > But then am getting a 500 error... What does the webserver log say? -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * --

Re: [PHP] Escape problems...why?

2004-04-22 Thread Ryan A
Hey John, Thanks for replying. I cant use strip slashes because there are a number of scripts doing DB things and searching for all of them and modifying things just for one client can be a royal PITA. I tried to use "php_flag magic_quotes_gpc off" in the *existing* .htaccess file like so: php_f

Re: [PHP] Escape problems...why?

2004-04-22 Thread John W. Holmes
Ryan A wrote: For example this insert statement: insert into test_ing values('a','a','a','a') becomes: insert into test_ing values (\'a\',\'a\',\'a\',\'a\') I immediatly suspected "magic_quotes" but checked (via phpinfo) and see that magic_quotes are off, as a safety precaution I even have "set_ma

[PHP] Escape problems...why?

2004-04-22 Thread Ryan A
Hi, I am accepting some SQL via a textarea on a webform and then saving that SQL in the database for later use everythings working fine on our test servers but for some reason on our clients servers its screwing up. For example this insert statement: insert into test_ing values('a','a','a','a'

Re: [PHP] Escape Characters

2003-02-27 Thread 1LT John W. Holmes
> I'm running a script that reads the contents of images and stores them > in a MySQL database. The problem I'm running into is that my server is > seeing "\" as escape characters and stripping them out. I assume this > has something to do with "Magic Quotes" or something of that nature but > I'm

[PHP] Escape Characters

2003-02-27 Thread Sysadmin
Hi All, I'm running a script that reads the contents of images and stores them in a MySQL database. The problem I'm running into is that my server is seeing "\" as escape characters and stripping them out. I assume this has something to do with "Magic Quotes" or something of that nature but I

Re: [PHP] Escape characters won't go away

2002-09-01 Thread Mike Mannakee
Thanks. I just figured it out myself. I had to change the expression: $string= ereg_replace("[\\]+", "", $string); The above is what worked. Mike "Justin French" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > on 02/09/02 1:14 PM, Mike Mannakee ([EMAIL PR

Re: [PHP] Escape characters won't go away

2002-09-01 Thread Justin French
on 02/09/02 1:14 PM, Mike Mannakee ([EMAIL PROTECTED]) wrote: > I'm getting multiple backslashes in data I get out of a mysql database. > > Example : > > ...Here\\\'s the d... > > No problem. Except I CANT GET RID OF THEM. I've tried several things: > > 1. $string = stripslashes($string);

[PHP] Escape characters won't go away

2002-09-01 Thread Mike Mannakee
I'm getting multiple backslashes in data I get out of a mysql database. Example : ...Here\\\'s the d... No problem. Except I CANT GET RID OF THEM. I've tried several things: 1. $string = stripslashes($string); - Doesn't do anything 2. $string = ereg_replace("\\", "", $string); - Does

[PHP] escape characters

2002-04-03 Thread Rob Packer
In the following statement, can someone tell me what I would need to escape out if I were to put it all into a variable (I know the quotes, but that's all) : if (!$name){ $error_msg.="Your Name \n"; } Thanks, Rob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: ht

[PHP] escape char hell

2001-07-16 Thread Steve Brett
hi, i've got myself into a bit of a mess. i have a database with approx 4000 records (mysql) and when i populated the database i was given 4000 text files with the product name as the file name and the description of the product as the contents. so i set up a text field in the table to hold the

Re: [PHP] escape characters

2001-04-06 Thread Adam
nevermind, i found them -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]

[PHP] escape characters

2001-04-06 Thread Adam
what is a list of all the characters that have to be escaped? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]

Re: [PHP] escape sequences not recognized inside an .html

2001-03-27 Thread Mauricio Junqueira
I've check the other articles and came up with the following: 1- take out the extension, html or php, inside the links in way that I can change from .html to .php and vice-versa without worrie to change all links. 2- and to add the .html to httpd.conf in order to all files to be parsed. Not too b

Re: [PHP] escape sequences not recognized inside an .html

2001-03-27 Thread Jason Stechschulte
On Sat, Mar 24, 2001 at 09:06:36PM -0500, Mauricio Junqueira wrote: > Hi, > I believe I am missing some configuration regarding my apache becouse > I can only get php to work inside a file .php. > If my page extension is .html, nothing happend with the php script; but > just changing from .html

RE: [PHP] escape sequences not recognized inside an .html

2001-03-24 Thread Jack Dempsey
would need to add the html extension to line with php. Otherwise, they're normal html... jack -Original Message- From: Mauricio Junqueira [mailto:[EMAIL PROTECTED]] Sent: Saturday, March 24, 2001 9:07 PM To: [EMAIL PROTECTED] Subject: [PHP] escape sequences not recognized inside an

[PHP] escape sequences not recognized inside an .html

2001-03-24 Thread Mauricio Junqueira
Hi, I believe I am missing some configuration regarding my apache becouse I can only get php to work inside a file .php. If my page extension is .html, nothing happend with the php script; but just changing from .html to .php everthing works fine. Anyone? Anyhelp? I'm new over php. I usually d

Re: [PHP] Escape slashes?

2001-03-13 Thread Christian Reiniger
On Monday 12 March 2001 20:27, you wrote: > Hi! > > I am trying to do some fileuploading.. but I am running into a problem > with escaping spaces. > > Basically, I have this directory that includes spaces and I need to be > able to change the spaces to "\ " so for example.. > > my directory is: Fu

[PHP] Escape slashes?

2001-03-12 Thread Tanya Brethour
Hi! I am trying to do some fileuploading.. but I am running into a problem with escaping spaces. Basically, I have this directory that includes spaces and I need to be able to change the spaces to "\ " so for example.. my directory is: Fun Documents I need to change it to: Fun\ Documents That

Re: [PHP] Escape %

2001-02-25 Thread Website4S
In a message dated 26/02/2001 07:17:57 GMT Standard Time, [EMAIL PROTECTED] writes: << there is addslashes(); http://www.php.net/manual/en/function.addslashes.php john >> addslashes() doesn`t work on the % sign though Ade -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP] Escape %

2001-02-25 Thread John LYC
there is addslashes(); http://www.php.net/manual/en/function.addslashes.php john [EMAIL PROTECTED] wrote: > Hi, > > Anyone know the best method to escape the % sign in PHP? > > I`ve checked the manual and devshed and didn`t come across much, is there a > command like addslashes() or would I h

[PHP] Escape %

2001-02-25 Thread Website4S
Hi, Anyone know the best method to escape the % sign in PHP? I`ve checked the manual and devshed and didn`t come across much, is there a command like addslashes() or would I have to use something like this... $Field="A%D%E"; $Field1=str_replace("%","percent",$Field); Thanks for any input Ade

Re: [PHP] Escape characters

2001-01-13 Thread Cynic
mail( 'email@address' , 'subject' , stripslashes( $body ) ) ; At 04:22 14.1. 2001, Jeremy Bowen wrote the following: -- >Hey All, > >I am sending e-mail using the mail() command. My question is whenever >an ' is used in

[PHP] Escape characters

2001-01-13 Thread Jeremy Bowen
Hey All, I am sending e-mail using the mail() command. My question is whenever an ' is used in the e-mail it is escaped like this: don\'t. Is there any way to prevent this?? Thanks, Jeremy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTEC