You are here: Re: Changes between some lines « PHP Programming Language « IT news, forums, messages
Re: Changes between some lines

Posted by Rik Wasmus on 12/27/07 17:06

On Tue, 25 Dec 2007 20:21:38 +0100, The87Boy <the87boy@gmail.com> wrote:=


> On Dec 25, 8:09 pm, The87Boy <the87...@gmail.com> wrote:
>> I have some files with urls and the only change between the urls is
>> the id, which stands as an argument
>
> As an argument in the url, as you e.g. can see on this url:
> http://localhost/index.php?cmd=3D14&id=3D3325253&from=3D2
>
>> but how can I see the id it in the easist way?

In the request itself:
$_GET['id']

Parsing the url as a string in another file (if you'd like to examine th=
e =

target in another script for instance):
$id =3D false;
$url =3D 'http://localhost/index.php?cmd=3D14&id=3D3325253&from=3D2';
$querystring =3D parse_url($url, PHP_URL_QUERY);
if(!empty($querystring)){
parse_str($querystring,$array);
$id =3D isset($array['id']) ? $array['id'] : false;
}
-- =

Rik Wasmus

 

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

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