----- Original Message -----
From: "Imar de Vries" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 14, 2002 12:53 PM
Subject: [PHP] Passing variables with include()
> Hi all,
> at this moment I am working on a script that calculates standings of our
> online racing competition. In order to do that, I have to connect to a
> database on a remote server.
> I have read in the php manual that
> When a file is include()ed, the code it contains inherits the variable
> scope of the line on which the include() occurs. Any variables available
> at that line in the calling file will be available within the called
> file. If the include() occurs inside a function within the calling file,
> then all of the code contained in the called file will behave as though
> it had been defined inside that function.
> But for some reason, i simply do not get the script to work. I use a
> form in the local script to determine which standings are to be shown,
> and the value is stored in $serie_id. This is done in the main scope (no
> function used). $serie_id can be 2, 3 or 4.
> Then I make an include call to the remote script:
I'd make a bet (I haven't tried it) that you receive the file already parsed
and so as pure html.
Try it with the extension .txt or something that the remote webserver
doesn't process before it outputs the content.
> In that remote script I use $serie_id to make a database query. But so
> far, the query fails because $serie_id is not known.
> Are there any known exceptions (f.i. specific server settings) that
> might explain why the variable is not known on the remote server?
> Thanks in advance!
> Imar de Vries - [EMAIL PROTECTED] - ICQ 6972439
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]