Re: [PHP] URL Parsing...

2007-11-26 Thread Jochem Maas
Richard Heyes wrote: > Chris wrote: >> Richard Heyes wrote: well if you take a string (filename) and wish to change the end of it somone then I don't think str_replace() is the correct function. what's to say a script doesn't exist called 'my.cfm.php'? >>> >>> How does this

Re: [PHP] URL Parsing...

2007-11-26 Thread Richard Heyes
Chris wrote: Richard Heyes wrote: well if you take a string (filename) and wish to change the end of it somone then I don't think str_replace() is the correct function. what's to say a script doesn't exist called 'my.cfm.php'? How does this: /\.cfm$/ take into account that? $ in regex's

Re: [PHP] URL Parsing...

2007-11-25 Thread Chris
Richard Heyes wrote: well if you take a string (filename) and wish to change the end of it somone then I don't think str_replace() is the correct function. what's to say a script doesn't exist called 'my.cfm.php'? How does this: /\.cfm$/ take into account that? $ in regex's means 'end of

Re: [PHP] URL Parsing...

2007-11-25 Thread Jochem Maas
Richard Heyes wrote: >> well if you take a string (filename) and wish to change the end of it >> somone >> then I don't think str_replace() is the correct function. what's to >> say a script >> doesn't exist called 'my.cfm.php'? > > How does this: > > /\.cfm$/ > > take into account that? WTF >

Re: [PHP] URL Parsing...

2007-11-25 Thread Richard Heyes
well if you take a string (filename) and wish to change the end of it somone then I don't think str_replace() is the correct function. what's to say a script doesn't exist called 'my.cfm.php'? How does this: /\.cfm$/ take into account that? -- Richard Heyes +44 (0)800 0213 172 http://www.webs

Re: [PHP] URL Parsing...

2007-11-25 Thread Jochem Maas
Richard Heyes wrote: >> one of these should give you something to go on: >> >> echo preg_replace('\.cfm$', '-meta.cfm', >> parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)), "\n"; >> echo preg_replace('\.cfm$', '-meta.cfm', $_SERVER['PATH_TRANSLATED']), >> "\n"; >> echo preg_replace('\.cfm$', '-met

Re: [PHP] URL Parsing...

2007-11-25 Thread Richard Heyes
one of these should give you something to go on: echo preg_replace('\.cfm$', '-meta.cfm', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)), "\n"; echo preg_replace('\.cfm$', '-meta.cfm', $_SERVER['PATH_TRANSLATED']), "\n"; echo preg_replace('\.cfm$', '-meta.cfm', $_SERVER['SCRIPT_FILENAME']), "

Re: [PHP] URL Parsing...

2007-11-24 Thread Jochem Maas
Amanda Loucks wrote: > Hi, > > I'm working on redesigning the backend of the website for work. It was > originally done in ColdFusion, but I'm switching it over to PHP - probably > going to transfer the website from where it's currently hosted to something > a lot cheaper, too, hence the switchin

Re: [PHP] URL Parsing...

2007-11-24 Thread tedd
At 12:18 PM -0600 11/24/07, Amanda Loucks wrote: Hi, I'm working on redesigning the backend of the website for work. It was originally done in ColdFusion, but I'm switching it over to PHP - probably going to transfer the website from where it's currently hosted to something a lot cheaper, too,

[PHP] URL Parsing...

2007-11-24 Thread Amanda Loucks
Hi, I'm working on redesigning the backend of the website for work. It was originally done in ColdFusion, but I'm switching it over to PHP - probably going to transfer the website from where it's currently hosted to something a lot cheaper, too, hence the switching to PHP. Anyway. Because we ar

Re: [PHP] URL parsing

2002-12-18 Thread 1LT John W. Holmes
> http://www.php.net/manual/en/function.parse-url.php If you're going to help, at least read the question. The poster already said they tried that and it's not even a solution, anyhow. The "username" it refers to in parse_url() is for URLs in the format of http://username:[EMAIL PROTECTED]. > >ht

Re: [PHP] URL parsing

2002-12-18 Thread Tim Ward
ED]> Sent: Wednesday, December 18, 2002 2:39 PM Subject: [PHP] URL parsing > I've got a URL like this: > > http://www.naturalist.com/~fungae/index.php > > which is stored in $http_referer (as parse_url from > $HTTP_REFERER). > > I'm trying to extract t

Re: [PHP] URL parsing

2002-12-18 Thread Wico de Leeuw
http://www.php.net/manual/en/function.parse-url.php At 06:39 18-12-02 -0800, Mako Shark wrote: I've got a URL like this: http://www.naturalist.com/~fungae/index.php which is stored in $http_referer (as parse_url from $HTTP_REFERER). I'm trying to extract the username (~fungae). I've read the do

[PHP] URL parsing

2002-12-18 Thread Mako Shark
I've got a URL like this: http://www.naturalist.com/~fungae/index.php which is stored in $http_referer (as parse_url from $HTTP_REFERER). I'm trying to extract the username (~fungae). I've read the docs on parse_url(), and have tried to get $http_referer[user], but it comes up with zilch. I've a

Re: [PHP] URL Parsing Help

2002-01-29 Thread Shane Lambert
Actually, I found a simpler way: $vars = str_replace("/","&",$PATH_INFO); parse_str($vars); But thanks for your help... Christopher William Wesley wrote: > $myPairs = explode( "/", $PATH_INFO ); > while( list( $key, $val ) = each( $myPairs ) ){ > if( !empty( $val ) ){ > $my

Re: [PHP] URL Parsing Help

2002-01-29 Thread Christopher William Wesley
$myPairs = explode( "/", $PATH_INFO ); while( list( $key, $val ) = each( $myPairs ) ){ if( !empty( $val ) ){ $myVar = explode( "=", $val ); ${$myVar[0]} = $myVar[1]; } } For you example URI, "index.php/option=contact/step=view" you would then have $

[PHP] URL Parsing Help

2002-01-29 Thread Shane Lambert
I am trying to write software that will allow me to pass variables to a php script like: index.php/option=contact/step=view When I do this, I get the varibal PATH_INFO which contains "/option=contact/step=view". Now, what I want is to have the following: $option = "contact" $step = "view" I

Re: [PHP] URL parsing

2001-03-25 Thread Jaxon
whups, sorry - here is the example: I want to turn URI's like: /script.php/main/index.html?junk=junk /script.php/main/index.html// /script.php/main/index.html?? all into: /script.php/main/index.html best regards, jaxon On 3/25/01 9:25 PM, "Aaron Tuller" <[EMAIL PROTECTED]> wrote: > why can'

Re: [PHP] URL parsing

2001-03-25 Thread Aaron Tuller
why can't you str_replace the $QUERY_STRING frm the $REQUEST_URI? give an example of what you are trying to do? (I'm sorry if you did and I missed it) -aaron At 9:06 PM -0500 3/25/01, Jaxon wrote: >K, read em all, and understood more than I thought I :) > > >I still don't see how you can 'san

Re: [PHP] URL parsing

2001-03-25 Thread Jaxon
K, read em all, and understood more than I thought I :) I still don't see how you can 'sanitize' a URI, eg discard anything including and after "//" or "??". I think this is needed if you want to discard a query string or irregular syntax from your URI. ereg's don't work reliably, due to the p

Re: [PHP] URL parsing

2001-03-25 Thread Philip Olson
Hi! Check out these two related articles (and user comments) : Building Dynamic Pages With Search Engines in Mind : * http://phpbuilder.com/columns/tim19990117.php3 * http://phpbuilder.com/columns/tim2526.php3 Also c

Re: [PHP] URL parsing

2001-03-25 Thread Jaxon
oops :) http://www.domain.com/index.php/main/index.html?ii=1 versus http://www.domain.com/index.php/main/index.html I want to get "index.html" and "main" into variables, as the two items will always be present - if $ii is set, I want to strip it from the URI before parsing the items out. I supp

Re: [PHP] URL parsing

2001-03-25 Thread CC Zona
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Jaxon) wrote: > Any way to combine both forms of url parsing? > I want to use standard slash notation for navigation ,but also account for > the occasional variable used within a single page. > > e.g. URL can be either: > domain.com/index.php/m

Re: [PHP] URL parsing

2001-03-25 Thread Jaxon
Any way to combine both forms of url parsing? I want to use standard slash notation for navigation ,but also account for the occasional variable used within a single page. e.g. URL can be either: domain.com/index.php/main/index.html?ii=1 or: domain.com/index.php/main/index.html?ii=1 if (isset(

Re: [PHP] URL parsing

2001-03-23 Thread Jaxon
u can change the separator in php.ini, and for sure you could do >>>> it by hand using $PATH_INFO or something. >>>> >>>> Personally, my first question would be if the new "standard" is actually >>>> being used or supported by anybody else.

Re: [PHP] URL parsing

2001-03-23 Thread Jaxon
>>> Visit the Zend Store at http://www.zend.com/store/ >>> Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm >>> Volunteer a little time: http://chatmusic.com/volunteer.htm >>> - Original Message - >>> From: Dave Smith <[

Re: [PHP] URL parsing

2001-03-23 Thread Aaron Tuller
>> >> -- >> Visit the Zend Store at http://www.zend.com/store/ >> Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm >> Volunteer a little time: http://chatmusic.com/volunteer.htm >> - Original Message ----- >> From: Dave Smith &l

Re: [PHP] URL parsing

2001-03-23 Thread Jaxon
.zend.com/store/ > Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm > Volunteer a little time: http://chatmusic.com/volunteer.htm > - Original Message - > From: Dave Smith <[EMAIL PROTECTED]> > Newsgroups: php.general > Sent: Saturday, March 17, 20

Re: [PHP] URL parsing

2001-03-23 Thread Richard Lynch
ore/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Dave Smith <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Saturday, March 17, 2001 10:55 AM Subject: [PHP] URL parsing

[PHP] URL parsing

2001-03-17 Thread Dave Smith
I have heard that the new standard for URLS is ...test.php?op=3;op2=6... using the semi colon as a seperator. Is this currently supported by php 4.0.3? Cheers Dave Smith -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail