Jump to content

pog

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

pog's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, I have a short script for processing some email addresses. The script contains the following form: [code]<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data"> <label for="openedfile">Choose a file:</label> <input type="file" name="openedfile"><br> <input type="submit" value="submit"><br> </form>[/code] I have some php in the page that looks like this: [code] $filename = $_FILES['openedfile']['name']; $fp = @fopen($filename, "r+") or exit("<br>Could not open file"); $contents .= @fread($fp, filesize($filename)) or exit("<br>Could not read file"); fclose($fp); [/code] Problem is, it only works if the chosen file is in the same directory as the script. Any other parent- or sub-directory and it says it doesn't exist. I'm guessing this is rrreally simple, but any help much appreciated!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.