[PHP] Auto escaping an apostrophy...

2004-09-20 Thread John Legg
Todd, >From the PHP manual: magic_quotes_gpc boolean Sets the magic_quotes state for GPC (Get/Post/Cookie) operations. When magic_quotes are on, all ' (single-quote), " (double quote), \ (backslash) and NUL's are escaped with a backslash automatically. Note: If the magic_quotes_sybase dire

RE: [PHP] preg_match question

2004-08-18 Thread John Legg
--- Is it clever to use word boundary here? "/b"? Nicke From: John Legg [mailto:[EMAIL PROTECTED] Sent: den 18 augusti 2004 18:02 To: "Nicklas Bondesson" Cc: [EMAIL PROTECTED] Subject: Re: [PHP] preg_match question Try using a p

Re: [PHP] preg_match question

2004-08-18 Thread John Legg
Try using a pattern set to the following: $pattern = "/^www.test.com$/"; and refer to: http://uk.php.net/manual/en/reference.pcre.pattern.syntax.php Rgds John --- Hello, How do I find an exact match of a string with preg_match? Example: String1: www.test.com/ String2: www.test.com/somepa

[PHP] Reg Exp.

2004-08-18 Thread John Legg
To start with try replacing: $patterns[1] = "//"; with $patterns[1] = "/<\/strike>/"; Rgds John --- Hi! Why can“t i get this code to work: $html = $_POST["htmlIn"]; $patterns[0] = "//"; $patterns[1] = "//"; $patterns[2] = "/align=\"left\"/"; $replacements[0] = ""; $replacements[1] = ""

Re: [PHP] Where is the Error

2002-07-11 Thread John Legg
millwOrm There shouldn't be "." (full stop) before $strChar on line 10: $function_ret=ConvertBin(.$strChar); You also have issues on line 30 (the for loop). Rgds John - Original Message - From: "millw0rm" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, July 11, 2002 8:41

Re: [PHP] regex for emoticon codes

2002-07-08 Thread John Legg
Hi Roger Try this: $str = "sometext sometext [emoticon01] sometext [emoticon23] sometext"; $new_str = preg_replace("/\[emoticon(\d\d)\]/", "/image/emot/\\1.gif", $str); print $new_str; Seems to work? Rgds John - Original Message - From: "Roger Thomas" <[EMAIL PROTECTED]> To: <[EMAI

Re: [PHP] strange behaviour of unset()

2002-07-08 Thread John Legg
Hi Liviu You also need to unregister the session var using session_unregister - unset will just unset the global. http://www.php.net/manual/en/function.session-unregister.php Rgds John - Original Message - From: "Liviu Andrei" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday,

Re: [PHP] Is there an easy way to divid up HTTP_USER_AGENT?

2002-07-05 Thread John Legg
Hi As far as I can see you need to manipulate HTTP_USER_AGENT yourself. Here is an example that I used to determine if the browser is MSIE and if so what version it is. What are you trying to determine? A specific browser? if (strStr($HTTP_USER_AGENT, "MSIE")) { $agent_array = split(";", $H

Re: [PHP] HTML & Java script doubt..

2002-07-04 Thread John Legg
Hi Balaji Have re-written the code now works.. two problems: 1. checkall() appears to be a reserved function - have renamed function to checkitall 2. You didn't need to put [] after OptionList in checkbox name function checkitall() { var n=0,i=document.form1.OptionList.length; while(n