Re: URL parsing

From: Date: Sun, 25 Mar 2001 20:18:42 +0000
Subject: Re: URL parsing
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-45511@lists.php.net to get a copy of this message
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/tim20000526.php3 Also check phpinfo() for available predefined variables and plan accordingly. Predefined Variables : -------------------------------------------------------- * http://www.php.net/manual/en/language.variables.predefined.php And for the brave, check out mod_rewrite : Mod-Rewrite : -------------------------------------------------------- * http://httpd.apache.org/docs/mod/mod_rewrite.html * http://www.engelschall.com/pw/apache/rewriteguide/ * http://marc.theaimsgroup.com/?l=php-general&s=mod_rewrite Regards, Philip Olson http://www.cornado.com/ On Sun, 25 Mar 2001, Jaxon wrote: > 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 suppose with parse_url() I could do something..but I really only want to > deal with the URI. > > currently, this seems to work: > > $path_array = explode('/', $REQUEST_URI); > > if (isset($ii)) array_pop($path_array); // remove $ii > $page_name = array_pop($path_array); //get page name from end of array > $tpl = array_pop($path_array); //get page type from next item > > but is inelegant :) > > regards, > jaxon > > > In article <B6E3A463.429C%jaxon@salamander.net>, > > jaxon@salamander.net (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/main/index.html?ii=1 > >> > >> or: > >> domain.com/index.php/main/index.html?ii=1 > > > > Umm, how are these different? > > > > (If you're trying to extract info from a url, perhaps > > parse_url(),basename(), and/or dirname() are what you're seeking...?) > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#45511) next »