Scott Phillips on Fri, 24 Jun 2005 09:32:45 -0500


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [ciapug] special chars in urls


Whwah? That's a new one for me. I'll have to give it a try for kicks. Reminds me of those blog permalinks done with the apache mod_rewrite module.


At 09:20 AM 6/24/2005 -0500, you wrote:
Hi,

There is another way to do it without any encoding at all using the
$PATH_INFO variable.

The URL would look something like this:

direct.php/http://www.foobar.com/blah.asp?id=5&action=poop

use $QUERY_STRING to access the query.

here is an example:

####### direct.php ######
<? echo("PATH_INFO = $PATH_INFO"); echo("
"); echo("QUERY_STRING = $QUERY_STRING"); ?>
###########################

After running direct.php/http://www.foobar.com/blah.asp?id=5&action=poop
you would get:
PATH_INFO = /http://www.foobar.com/blah.asp
QUERY_STRING = id=5&action=poop

Just remove the first '/' on $PATH_INFO and you are set to go.

Bye
Cesar Mendoza
http://www.kitiara.org
--
"The fate of all mankind I see
Is in the hands of fools."
  --King Crimson, Epitaph


On Tue, Jun 21, 2005 at 10:36:43AM -0500, Scott Phillips wrote: > I want to create a page (direct.php) that can take a url as a parameter > like: > > direct.php?url=http://www.foobar.com/blah.asp?id=5&action=poop > > but the ? and & characters will cause problems, no? At first, I thought > passing the url parameter through htmlspecialchar() when creating the link > might work... until I actually thought about it. (Duh.) There must be > some other way to do it. > > Any suggestions? > > > Scott Phillips > Web Developer > Cowles Library, Drake University > (515) 271-2975 > > _______________________________________________ > ciapug mailing list > ciapug@xxxxxxxxxx > http://cialug.org/mailman/listinfo/ciapug

_______________________________________________
ciapug mailing list
ciapug@xxxxxxxxxx
http://cialug.org/mailman/listinfo/ciapug

_______________________________________________ ciapug mailing list ciapug@xxxxxxxxxx http://cialug.org/mailman/listinfo/ciapug