[PHP] Re: Help with Regular Expressions

2004-08-15 Thread killu0007-widget
Hi all, I am working on a small php script which should do the following. I want all the links in the page to be preceded by first character and first two characters of the link.Please look into the example below for more clarification. eg. a href=/code.htmllink here/a to be replaced as a

Re: [PHP] Re: Help with Regular Expressions

2004-08-15 Thread Octavian Rasnita
From: [EMAIL PROTECTED] Hi all, I am working on a small php script which should do the following. I want all the links in the page to be preceded by first character and first two characters of the link.Please look into the example below for more clarification. eg. a href=/code.htmllink

Re: [PHP] Re: help condensing regular expressions

2002-04-06 Thread Tom Rogers
Hi I have never used .htaccess but I'll read up on it, I am the ISP so it won't be a problem :) Tom At 06:12 PM 6/04/2002, Chris Adams wrote: In article [EMAIL PROTECTED], Tom Rogers wrote: Thats what I was after :) Glad I could help. At the top of each page I now do $reltoroot =

[PHP] Re: help condensing regular expressions

2002-04-05 Thread Julio Nobrega Trabalhando
How about: $site_root = '/www/user/htdocs/'; img src=?php echo $site_root; ?images/logo.png / Instead of going relative, go from the root. Or you could put $site_root as your url: $site_root = 'http://www.your_site.com/'; -- Julio Nobrega. Um dia eu chego lá:

Re: [PHP] Re: help condensing regular expressions

2002-04-05 Thread Tom Rogers
Hi Yes that would be fine for the html examples I gave but the real use is for php to find the include directory which I keep out of the server tree, one directory back like this include($relative_root.../include/mysql_connect.inc) Each domain has its own include directory which I want to

RE: [PHP] Re: help condensing regular expressions

2002-04-05 Thread Collins, Robert
: Friday, April 05, 2002 2:33 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Re: help condensing regular expressions Hi Yes that would be fine for the html examples I gave but the real use is for php to find the include directory which I keep out of the server tree, one directory back like

RE: [PHP] Re: help condensing regular expressions

2002-04-05 Thread Tom Rogers
PROTECTED] Subject: Re: [PHP] Re: help condensing regular expressions Hi Yes that would be fine for the html examples I gave but the real use is for php to find the include directory which I keep out of the server tree, one directory back like this include($relative_root.../include/mysql_connect.inc

[PHP] Re: help condensing regular expressions

2002-04-05 Thread Chris Adams
In article [EMAIL PROTECTED], Tom Rogers wrote: I am trying to calculate how far into a directory structure I am so that I can include images and include files without having to hard code them. I need to turn $PHP_SELF which could be /admin/emails/index.php into ../../ which I can then use

Re: [PHP] Re: help condensing regular expressions

2002-04-05 Thread Tom Rogers
Thanks Chris Thats what I was after :) At the top of each page I now do $reltoroot = preg_replace(|/[^/]+|, ../, dirname($_SERVER['PHP_SELF'])); ini_set (include_path,ini_get(include_path).:.$reltoroot.../include); which takes care of the include path I use the path translated info for pages

Re: [PHP] Re: help condensing regular expressions

2002-04-05 Thread Chris Adams
In article [EMAIL PROTECTED], Tom Rogers wrote: Thats what I was after :) Glad I could help. At the top of each page I now do $reltoroot = preg_replace(|/[^/]+|, ../, dirname($_SERVER['PHP_SELF'])); ini_set (include_path,ini_get(include_path).:.$reltoroot.../include); which takes care

[PHP] Re: Help with regular expressions

2002-01-25 Thread liljim
Hi Daniel, José daniel ramos wey ... Hi! I´m new to regular expressions, and it seems to be an art to make it work as expected. I´m trying to remove all single-line comments from an string - that´s everything after // to the end of a line. I expected that this would do the job:

[PHP] Re: HELP with Regular Expressions

2001-08-21 Thread Richard Lynch
if (($hostname) || ($HOSTNAME)) { $hostname= trim($hostname); if ($HOSTNAME) $hostname = trim($HOSTNAME); if (!eregi(^[-a-z0-9-]+(\.[a-z0-9-]+)*$ , $hostname)) { print_error(your byour hostname/b is invalid); } $HOSTNAME = $hostname; } Things I know are wrong: