September 21, 2020, 01:21:14 pm
News: If someone gives you crap then give them a Bad Star
Pages: [1]   Go Down
Author Topic: Lost Topic Title  (Read 494 times)
Full Member

Stars: +0/-0
Offline Offline

Posts: 172

« on: February 24, 2005, 08:18:26 am »

hey guys,
can't seem to figure out the problem here:

I'm creating a quick and simple form to upload a file and then search it's contents for the string entered ( an IP in a log file ).
However, as soon as I put enctype='multipart/form-data', the form doesn't return anything, not even the name of the text file or file uploaded or anything! It return the details when I don't put it in though.....

here is the code snippet:
PRINT "<form  method='post' action='$PHP_SELF' enctype='multipart/form-data'>
entrer adresse IP:&nbsp;<input type='text' name='ip'><br>  
<input type='hidden' name='MAX_FILE_SIZE' value='16000000' >
  fichier:&nbsp;<input name='userfile' type='file' size=60 maxlength='400' ><BR>
  <input type='submit' name='submit' value='go' >

and if the submit is clicked:

$submit = $_POST['submit'];
echo 'test'.$submit;
$value = $_POST['ip'];
if($submit == "go"){
$UploadDir = '/data/htdocs/fichier/';
$UploadFileName = $UploadDir . $_FILES['userfile']['name'];

echo 'echo'.$value;
echo 'file: '.$UploadFileName;

Like i said, if the enctype='multipart/form-data' is in, it displays:
echofile: /data/htdocs/fichier/

however if it isn't in:
echo "ip address typed"file: /data/htdocs/fichier/"name of file entered"

I can't figure out why it won't work!


"Mistakes are the portals for discovery." - James Joyce, In Motivation

Anatomy (n): something everyone has, but which looks better on a girl - Bruce Reeburn

Living somewhere in the world of tomorrow.

Pages: [1]   Go Up
Jump to: