|
Posted by Rob on 02/01/08 16:09
On Feb 1, 2:06 pm, "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
>
> --
You question is not wrong, you are just thinking about it the wrong
way.
In first.php :-
include("second.php");
second_function($_GET['id']);
second.php will then look like this :-
<?php
function second_function($id) {
.....
do_something_with_id;
.....
}
Rob.
Navigation:
[Reply to this message]
|