Re: Re: Passing variables with include()
| From: | Stefan Rusterholz | Date: | Mon, 14 Jan 2002 14:03:16 +0000 |
| Subject: | Re: Re: Passing variables with include() | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-80454@lists.php.net to get a copy of this message | ||
Since some time there has only one difference left (don't know at which
version it changed):
include causes a warning and require an error on fail. (very useful for
debugging - require your error-handler and include everything else)
best regards
Stefan Rusterholz
----- Original Message -----
From: "Scott Houseman" <ScottH@jamwarehouse.com>
To: <php-general@lists.php.net>
Sent: Sunday, January 13, 2002 2:54 PM
Subject: Re: [PHP] Re: Passing variables with include()
> Hi Al.
>
> While we are on topic, what are the key differences between include() &
> require() ?
>
> Cheers
>
> Scott
>
> ----- Original Message -----
> From: "Martin Wickman" <wizball@hotbrev.com>
> To: <php-general@lists.php.net>
> Sent: Monday, January 14, 2002 3:40 PM
> Subject: [PHP] Re: Passing variables with include()
>
>
> > Imar De Vries wrote:
> >
> > > Imar De Vries wrote:
> > >
> > >
> > >>- Including remote files *is* possible. The php manual does not
mention
> this
> > >>does not work, and when I add the variable to the call (include
> > >>..../calculate_drivers?serie_id=3.php) the code is processed
perfectly.
> The
> > >>thing is, I can not pass the variable with the call, because it's
value
> is
> > >>determined by the form field. I could use a switch statement of
course,
> but
> > >>that adds a lot more text to the code.
> > >>
> > >
> > > I just changed the code to (include
> > > .../calculate_drivers?serie_id=$serie_id.php)
> > >
> > > ... and this worked! Weird solution...
> >
> > Not really. The http://.../foo.php request returns html
> > and not php.
> > The foo.php file is parsed and executed by the remote server and
> > returned to you as html. By adding serie_id=xxx you actually give the
> > remote php-script the name and value of the variable.
> >
> > You should think of include/require as a way to *include* any file
> > into your script. Instead of cutting and pasting code into your file,
> > you use include. Thats the way it works in practice. No magic is going
> > on here :-)
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
>