Re: Defining PHP varibles from URL
| From: | Pedro Pontes | Date: | Mon, 06 May 2002 09:34:53 +0000 |
| Subject: | Re: Defining PHP varibles from URL | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-96221@lists.php.net to get a copy of this message | ||
The way you're doing it now, you're first ERASING whatever value passed from
the URL, with
$file="";
and then trying to use it...
If this ' $file="" ' is some declaration attempt, just drop it, you don't
need to declare variables in PHP. Just check if $file has a value and then
use it.
For example,
if ($file != "")
include($file);
Hope it helps.
--
Pedro Alberto Pontes
<webmaster@tececo.com> wrote in message
news:009501c1f4e0$636d3e80$0100a8c0@JohnH...
I don't mean to be a pain but could someone send me a working example?
I am what you would probably call a 'newbie'
For those who don't know here is my previous message
can't seem to define a varible from the url entered into a browser.
I wish to use the following code or something like it.
<script language="php">
$file = "";
//the above is defined from the url
include "$file";
</script>
It could be what I was typing in the url bar.
file.php?file=foobar.inc
Thanks,
JJ Harrison
webmaster@tececo.com
www.tececo.com