You are here: Re: change URL variables « PHP Programming Language « IT news, forums, messages
Re: change URL variables

Posted by Jerry Stuckle on 03/01/07 20:29

abscons@gmail.com wrote:
> On Mar 1, 12:09 am, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>> absc...@gmail.com wrote:
>>> On Feb 28, 8:57 am, Sjoerd <sjoerd-n...@linuxonly.nl> wrote:
>>>> absc...@gmail.com wrote:
>>>>> Hi out there,
>>>>> I have an url that looks like this:http://host/file?var=value.
>>>>> I am trying to replace the "value" part in my url and assign it to a
>>>>> link on my page. I tried to parse the url but can only get the part
>>>>> before the ? not included.
>>>>> Is there any way to do so?
>>>> Yes. What do you have so far? Have you looked at $_SERVER[QUERY_STRING]
>>>> and $_SERVER[REQUEST_URI]?
>>>> http://nl3.php.net/manual/en/reserved.variables.php#reserved.variable...
>>> This is the error I get when using REQUEST_URI: Notice: Undefined
>>> index: REQUEST_URI
>> It needs to be:
>>
>> $_SERVER['REQUEST_URI']
>>
>> Note the quotes - this is an index in the $_SERVER array.
>>
>> --
>> ==================
>> Remove the "x" from my email address
>> Jerry Stuckle
>> JDS Computer Training Corp.
>> jstuck...@attglobal.net
>> ==================
>
> My exact call are:
> $url = $_SERVER['REQUEST_URI'];
> echo "URI: ".$url."<br/>";
>
> and still: Notice: Undefined index: REQUEST_URI in index.php on line
> 21
>
>

Well, it should work, if your server is passing it on to PHP. Which
server are you using?

What does phpinfo() show? It should show REQUEST_URI.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация