Access the answers to your technology questions today.
Subscribe Now
30-day free trial. Register in 60 seconds.
What Makes Experts Exchange Unique?
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.
Try it out and discover for yourself.
Subscribe Now
30-day free trial. Register in 60 seconds.
Join the Community
Give a Little. Get a Lot.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Join the Community
by: ZontarPosted on 2003-12-18 at 23:57:55ID: 9970563
<?php /include-f ile") or "/system/path/to/include-f ile" ta">
include( realpath("fileA.php") ); // use either realpath("relative/path/to
if($_POST["uploadit"] == "true")
fileupload();
?>
<form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post" enctype="multipart/form-da
<input type="file" name="file1">
<input type="hidden" name="uploadit" value="true">
<input type="submit" value="submit">
</form>
The $_POST and $_FILES variables are superglobals and are available within functions. Use $_FILES instead of $_REQUEST to get uploaded file info; as of PHP 4.3.0, this information is no longer indluded in the $_REQUEST collection.
In fact, I do not recommend using $_REQUEST at all, as this allows people to hack your POST forms using the querystring ($_GET variables). Use $_POST instead.