[PHP] Escaping '#' Sign

2002-12-11 Thread Mike Smith
I have a string I'm returning from a database. Some entries have # signs in the names ie (COMPANY #42, COMPANY #43...). When I display results all I have is COMPANY. Everything after the # is dropped off. I tried: If ($cust) { $cust2=ereg_replace('#','no',$cust); //tried

Re: [PHP] Escaping '#' Sign

2002-12-11 Thread Richard Baskett
Why don't you just try: $cust2 = str_replace('#','#35;',$cust); That should replace all instances of # with it's html entity equivalent. If that doesn¹t work then there is something else wrong with your script and we'll need to see it all! :) Rick People who drink to drown their sorrow should

Re: [PHP] Escaping '#' Sign

2002-12-11 Thread Tom Woody
Have to be a bit more specific, cause I can't reproduce your problem... Do you have some code examples that show it clearer? name for client is COMPANY #1 in DB ?php include dbconnect.inc; //sets up db connection $sel = mysql_query(select name from client where

Re: [PHP] Escaping characters won't work

2002-11-15 Thread @ Edwin
Hello, Ernest E Vogelsinger [EMAIL PROTECTED] wrote: At 23:53 14.11.2002, Lars Espelid said: [snip] Try to execute this code: if (ereg[^0-9], $num)) print That's not a number!; result: parsing error, expects ')' on the if-line. You forgot an

[PHP] Escaping characters won't work

2002-11-14 Thread Lars Espelid
Hello, I'm running Apache 1.3.26, PHP 4.0.5 and WinXPpro. My problem is as follows: Try to execute this code: if (ereg[^0-9], $num)) print That's not a number!; result: parsing error, expects ')' on the if-line. Have also tried other expressions where I escape characters. They won't work.

Re: [PHP] Escaping characters won't work

2002-11-14 Thread John Nichel
Hello again... Lars Espelid wrote: Hello, I'm running Apache 1.3.26, PHP 4.0.5 and WinXPpro. My problem is as follows: Try to execute this code: if (ereg[^0-9], $num)) print That's not a number!; result: parsing error, expects ')' on the if-line. This one does have a parse error

Re: [PHP] Escaping characters won't work

2002-11-14 Thread Ernest E Vogelsinger
At 23:53 14.11.2002, Lars Espelid said: [snip] Try to execute this code: if (ereg[^0-9], $num)) print That's not a number!; result: parsing error, expects ')' on the if-line. You forgot an opening bracket, and need to quote the regex, like if

[PHP] Escaping escaped chars

2002-06-20 Thread Gerard Samuel
Im trying to move some binary strings from mysql to postgresql, and the binary strings has escape chars '\' in them. I was told to double escape them like so - '\\\' Here is what Im trying - $data = '\0P Z\0Îê˜Úµ'; // This is a representation from an mysql dump $data2 = str_replace('/\',

Re: [PHP] Escaping escaped chars

2002-06-20 Thread Michael Sweeney
Just escape the \ with a single escape character. eg. your string '\0P Z\0Îê˜Úµ' would end up as '\\0P Z\\0Îê˜Úµ' - each \ simply escapes the backslash following it. If you add two backslashes, you end up with one too many which is what the error is referring to. ..micahel.. On Thu,

Re: [PHP] Escaping escaped chars

2002-06-20 Thread Gerard Samuel
One of the guys over on the php-db list told me that to store the binary string correctly in postrgresql, that I would have to double quote whats already there. So in essence, by the time it hits the database, it has to be - \\\0P Z\\\0Îê˜Úµ Any suggestions to modify the string like this...

[PHP] escaping quotes in forms and redisplaying variables in form fields

2002-05-06 Thread John Hughes
I'm stumbling over how to allow people to put single or double quotes in a form text field. I am passing the form to itself ($PHP_SELF) and on the second time through previewing what the form data will look like and also re-creating the form with the data already filled in. Here's an example

Re: [PHP] escaping quotes in forms and redisplaying variables in form fields

2002-05-06 Thread Robert Cummings
See: http://www.php.net/manual/en/function.htmlspecialchars.php John Hughes wrote: I'm stumbling over how to allow people to put single or double quotes in a form text field. I am passing the form to itself ($PHP_SELF) and on the second time through previewing what the form data will

Re: [PHP] escaping quotes in forms and redisplaying variables in form fields

2002-05-06 Thread 1LT John W. Holmes
is ignored. Same for the double quotes. ---John Holmes... - Original Message - From: Robert Cummings [EMAIL PROTECTED] To: John Hughes [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Monday, May 06, 2002 5:06 PM Subject: Re: [PHP] escaping quotes in forms and redisplaying variables in form

[PHP] escaping PHP's closing tags

2002-03-27 Thread Erik Price
Hi -- I'm trying to use a string of XML data which includes the use of the ?xml ? tags. I've noticed that my editor (BBEdit) shows that \? will escape the tag so that PHP does not treat it as a true close the PHP code tag, but was hoping that someone here could give me an official ruling.

[PHP] Escaping Quotes in a String and Ending With A Quote

2002-03-19 Thread Dr. Shim
Well, this is a fairly simple problem. I'm having problems with escaping a string, and then ending the string right after the escape! For example, echo Then Johnathan said, \That's exactly what I said!\; I get a parse error on the line where the string is. Very simple problem, I just can't seem

Re: [PHP] Escaping Quotes in a String and Ending With A Quote

2002-03-19 Thread Miguel Cruz
On Tue, 19 Mar 2002, Dr. Shim wrote: Well, this is a fairly simple problem. I'm having problems with escaping a string, and then ending the string right after the escape! For example, echo Then Johnathan said, \That's exactly what I said!\; I get a parse error on the line where the string

Re: [PHP] Escaping Quotes in a String and Ending With A Quote

2002-03-19 Thread Dr. Shim
Hmmm. How about this? echo form name=\frmMovies\ method=\post\ action=\ . echo $PHP_SELF . \; Miguel Cruz [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Tue, 19 Mar 2002, Dr. Shim wrote: Well, this is a fairly simple problem. I'm having problems with

Re: [PHP] Escaping Quotes in a String and Ending With A Quote

2002-03-19 Thread Bob
You need to remove the second echo. On Tue, 19 Mar 2002, Dr. Shim wrote: Hmmm. How about this? echo form name=\frmMovies\ method=\post\ action=\ . echo $PHP_SELF . \; Miguel Cruz [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Tue, 19 Mar 2002,

Re: [PHP] Escaping Quotes in a String and Ending With A Quote

2002-03-19 Thread Miguel Cruz
On Tue, 19 Mar 2002, Dr. Shim wrote: Hmmm. How about this? echo form name=\frmMovies\ method=\post\ action=\ . echo $PHP_SELF . \; You're concatenating echo $PHP_SELF rather than just $PHP_SELF, which isn't necessarily helping. But just between me and you, life would be a lot easier if

Re: [PHP] Escaping Quotes in a String and Ending With A Quote

2002-03-19 Thread Dr. Shim
Strangley enough, $PHP_SELF is empty. Nothing appears when I do it the way Bob and you suggested, the action property equals . Miguel Cruz [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Tue, 19 Mar 2002, Dr. Shim wrote: Hmmm. How about this? echo form

Re: [PHP] Escaping Quotes in a String and Ending With A Quote

2002-03-19 Thread Miguel Cruz
Are you inside a function, having neglected to do global $PHP_SELF; ? miguel On Tue, 19 Mar 2002, Dr. Shim wrote: Strangley enough, $PHP_SELF is empty. Nothing appears when I do it the way Bob and you suggested, the action property equals . Miguel Cruz [EMAIL PROTECTED] wrote in

Re: [PHP] Escaping Quotes in a String and Ending With A Quote

2002-03-19 Thread Dr. Shim
*screams, I'm such a newbie!!* I didn't know I had to declare $PHP_SELF with global before using it inside a function. Sorry! Works now! Thanks very much! =) Miguel Cruz [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Are you inside a function, having neglected

RE: [PHP] escaping ?

2002-02-11 Thread Jerry Verhoef (UGBI)
PROTECTED] Subject: RE: [PHP] escaping ? what about this? $contents = str_replace('?xml version=1.0?'.'', '', $contents); -Original Message- From: Steven Jarvis [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 09, 2002 8:46 AM To: [EMAIL PROTECTED] Subject: [PHP] escaping

RE: [PHP] escaping ?

2002-02-10 Thread Martin Towell
what about this? $contents = str_replace('?xml version=1.0?'.'', '', $contents); -Original Message- From: Steven Jarvis [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 09, 2002 8:46 AM To: [EMAIL PROTECTED] Subject: [PHP] escaping ? I'm trying to do some string replaces on XML

[PHP] escaping ?

2002-02-08 Thread Steven Jarvis
I'm trying to do some string replaces on XML files to import them into a prprietary db that doesn't understand XML. I need to strip the XML tags out of the file. However, when I use this line: $contents = str_replace('?xml version=1.0?', '', $contents); The ? in the string ends my php block.

Re: [PHP] escaping ?

2002-02-08 Thread Jeff Sheltren
Hi, try this: str_replace(?xml version=\1.0\? Jeff At 03:45 PM 2/8/2002 -0600, Steven Jarvis wrote: I'm trying to do some string replaces on XML files to import them into a prprietary db that doesn't understand XML. I need to strip the XML tags out of the file. However, when I use this

[PHP] Escaping a double-quote problem

2002-02-01 Thread Anton Kolev
Any idea why when I print the value of $text, I get a backslash in front of the result? $text=preg_replace(/\/, quot;, $text); $text=preg_replace(/\/, A, $text); $text=str_replace(\, A, $text); Contrary: $text=preg_replace(//, amp;, $text); works quite well. cheerz -- PHP General

[PHP] Escaping from

2001-05-16 Thread Augusto Cesar Castoldi
I'm tring to print the variable tmp, but the echo is just printing abcd, the rest he can't print. Why? regards, Augusto $tmp=abcdefg; echo $tmp.br; echo br; $tmp=addslashes($tmp); echo $tmp.br; echo br; $tmp=stripslashes($tmp); echo $tmp.br; -- PHP General Mailing List

Re: [PHP] Escaping from

2001-05-16 Thread Christopher Heschong
on 5/16/01 9:12 PM, Augusto Cesar Castoldi at [EMAIL PROTECTED] wrote: I'm tring to print the variable tmp, but the echo is just printing abcd, the rest he can't print. Why? regards, Augusto $tmp=abcdefg; echo $tmp.br; echo br; $tmp=addslashes($tmp); echo $tmp.br; echo br;

Re: [PHP] Escaping Characters

2001-04-25 Thread Yasuo Ohgaki
""Wade"" [EMAIL PROTECTED] wrote in message 9c6dcb$h8e$[EMAIL PROTECTED]">news:9c6dcb$h8e$[EMAIL PROTECTED]... Aside from " (quotes), which HTML characters should be preceded with a \ (backslash) to avoid parsing errors? No. I have the following, which I have in an .inc file outside my web

RE: [PHP] Escaping Characters

2001-04-25 Thread PHPBeginner.com
-Original Message- From: Wade [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 25, 2001 8:47 PM To: [EMAIL PROTECTED] Subject: [PHP] Escaping Characters Aside from (quotes), which HTML characters should be preceded with a \ (backslash) to avoid parsing errors? I have the following

Re: [PHP] Escaping Characters

2001-04-25 Thread Yasuo Ohgaki
My previous post is a bit misleading. ""Wade"" [EMAIL PROTECTED] wrote in message 9c6dcb$h8e$[EMAIL PROTECTED]">news:9c6dcb$h8e$[EMAIL PROTECTED]... Aside from " (quotes), which HTML characters should be preceded with a \ (backslash) to avoid parsing errors? No and Yes. NO: You don't have to

[PHP] Escaping Characters - URL Encoding.

2001-04-24 Thread Sterling
H- I've been able to escape the 'space' character in a variable so it can be safely passed through a URL but I'm having trouble finding anything that works for escaping the '' ampsand. Here is a snippet of code. $topic = Aerospace Commercial Space; $link_value = str_replace(, '%26',

Re: [PHP] Escaping Characters - URL Encoding.

2001-04-24 Thread Alexander Wagner
Sterling wrote: $topic = Aerospace Commercial Space; $link_value = str_replace(, '%26', $topic); $link_value = str_replace(' ', '%20', $topic); This should be $link_value = str_replace(, '%26', $topic); $link_value = str_replace(' ', '%20', $link_value); Anyway, this is this wrong way to

Re: [PHP] Escaping Characters - URL Encoding.

2001-04-24 Thread Rasmus Lerdorf
I've been able to escape the 'space' character in a variable so it can be safely passed through a URL but I'm having trouble finding anything that works for escaping the '' ampsand. php.net/urlencode as for your code: $topic = Aerospace Commercial Space; $link_value = str_replace(,

[PHP] escaping php syntax within perl

2001-03-20 Thread Clayton Dukes
Hey everyone, Doesn anyone knowhow to escape the following line in a perl print statement? if(!isset($mainfile)) { include("mainfile.php"); } ie: sub header{ print "?php echo if(!isset($mainfile)) { include(\"mainfile.php\"); } ?\n"; } What all needs to be escaped? Thanks! Clayton

[PHP] Escaping double quotes?

2001-02-24 Thread Ben Cheng
How do you escape double quotes? I have the following which is supposed to make any " in a string into \" but it doesn't seem to work. What's wrong with it? $tmp_string = str_replace ("\"", "\\\"", $tmp_string); -Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP] Escaping double quotes?

2001-02-24 Thread Joe Stump
addslashes() usually works for me... --Joe On Sun, Feb 25, 2001 at 01:46:30AM -0500, Ben Cheng wrote: How do you escape double quotes? I have the following which is supposed to make any " in a string into \" but it doesn't seem to work. What's wrong with it? $tmp_string = str_replace

<    1   2