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 html head script language=javascript function checkitall() { var

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(;,

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, July

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: [EMAIL

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 AM

[PHP] Reg Exp.

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

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:

RE: [PHP] preg_match question

2004-08-18 Thread John Legg
? /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 pattern set to the following: $pattern = /^www.test.com$/; and refer to: http

[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