You are here: Re: open or output the script with arguments « PHP Programming Language « IT news, forums, messages
Re: open or output the script with arguments

Posted by Captain Paralytic on 02/01/08 15:12

On 1 Feb, 14:06, "bobo" <fourtwent...@yahoo.com> wrote:
> Hello,
> How can I output the file with arguments... i.e
> I have a file called first.php
> and i have a file called second.php
> what I want to do is output the first.php, but with arguments...
> something like this
> first.php?id=1
>
> and in the first.php I check the id... and run the script depending on
> the id... so... if id is 1... it outputs... i.e. 'first test', and if
> id is 2, it outputs 'second test'
>
> so... what I want to do is...
> output first.php?id=1
> and to get -> first test
> and if I output first.php?id=2
> to get -> second test
>
> any ideas?
>
> thx
>
> --

One thing that is I think confusing people is your use of the word
"output". A script may output something (usually by means of an echo
statement). Scripts may be called by invoking them through a web
server via a URL, containing the arguments that you suggest (e.g. ?
id=1) or maybe on the command line.

When you include a script, you are just getting the contents into the
script you are currently executing. So if the script you are including
wants to find something in the $_GET array, put it in there before you
include it. However, it feels that you should really be coding using
classes or at least functions for this job.

 

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

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