Re: Low-Cost PHP Hosts?

From: Date: Thu, 09 Nov 2000 20:16:50 +0000
Subject: Re: Low-Cost PHP Hosts?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-24547@lists.php.net to get a copy of this message
Innovative, but awfully verbose! Try something like this, that I use if stuff expected to be on the querystring is missing: > if (!empty($PATH_INFO) and ($PATH_INFO[0] == "/")) > { > $pi = substr( $PATH_INFO, 1, 999 ); > $data_ary = split( "=", $pi ); // we get /{$data_ary[0]}={$data_ary[1]}/... > $form[$data_ary[0]] = $data_ary[1]; > } > -David Schwartz Brian Clark wrote: > Nebbe, Joelle wrote: > > >>and to search engines. > > > >Alas no, it will only work as long as you do not pass parameters > >If you start passing parameters many search engines will decide to > >ignore it (characters like ?, &, =) > >unless you configure your system to allow things like > > > >`ÝIŸT4JÀ*2 > >záhttp://myserver/some/path/here/index.html/variable1/variable2 > > > >Now i have done this with cgi scripts, using scriptalias, but I > >have not tried it with php. Not sure how you can do it without > >having too much of a performance hit for every other page. > > While not pretty, I use something along the lines of: > > function ParseQueryString() > { > /* Ie: script.php/var1=value/var2=value */ > > $request = $GLOBALS['REQUEST_URI']; > ereg("/([[:alnum:]]+\.php3?)", $request, $match); > if(count($match) > 0) > { > $string = explode("$match[1]/", $request); > $query = explode("/", $string[1]); > while(list(,$value) = each($query)) > { > $pair = explode('=', $value); > $GLOBALS[$pair[0]] = $pair[1]; > } > } > } > > But I'm sure there is an easier way. > > -Brian > > -- > 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 (#24547) next »