|
-
Jun 30th, 2002, 12:37 PM
#1
Thread Starter
Fanatic Member
Query string problems
This is my code:
PHP 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?
Alcohol & calculus don't mix.
Never drink & derive.
-
Jun 30th, 2002, 01:04 PM
#2
Hyperactive Member
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.
-
Jun 30th, 2002, 01:11 PM
#3
Member
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:
PHP Code:
$HTTP_POST_VARS['file']
Unless they're one in the same.
-
Jun 30th, 2002, 01:13 PM
#4
-
Jun 30th, 2002, 02:29 PM
#5
Thread Starter
Fanatic Member
K, that works fine. Thanks
Alcohol & calculus don't mix.
Never drink & derive.
-
Jun 30th, 2002, 03:27 PM
#6
Originally posted by filburt1
There's also:
PHP Code:
$HTTP_POST_VARS['file']
Unless they're one in the same.
can you say deprecated...
-
Jun 30th, 2002, 07:10 PM
#7
Hyperactive Member
i tried to insinuate it...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|