Click to See Complete Forum and Search --> : Query string problems
Wynd
Jun 30th, 2002, 12:37 PM
This is my code:
<?
if (!isset($file))
{
$contents = "You did not specify a file";
}
else
{
$pFile = fopen($file, "r");
$contents = fread($pFile, filesize($file));
fclose($pFile);
}
echo $contents;
?>
The problem is, no matter what I put in, it always prints the error message. What am I doing wrong?
Kagey
Jun 30th, 2002, 01:04 PM
hmm.. if you are getting the $file variable from a querystring or a form POST submission, be sure that register_globals = on in the php.ini file. if not, you can use the
$_GET["file"] or $_POST["file"]
variables to get the value.
hope this helps.
filburt1
Jun 30th, 2002, 01:11 PM
Originally posted by Kagey
hmm.. if you are getting the $file variable from a querystring or a form POST submission, be sure that register_globals = on in the php.ini file. if not, you can use the
$_GET["file"] or $_POST["file"]
variables to get the value.
hope this helps.
There's also:
$HTTP_POST_VARS['file']
Unless they're one in the same.
Kagey
Jun 30th, 2002, 01:13 PM
that works too... :(
Wynd
Jun 30th, 2002, 02:29 PM
K, that works fine. Thanks :)
scoutt
Jun 30th, 2002, 03:27 PM
Originally posted by filburt1
There's also:
$HTTP_POST_VARS['file']
Unless they're one in the same.
can you say deprecated... ;)
Kagey
Jun 30th, 2002, 07:10 PM
i tried to insinuate it...
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.