File Parsing For Dummies
Posted: Thu Nov 10, 2005 7:47 pm
Sorry for posting two topics, but I thought the other one looked pretty full.
I had been trying to do this project of mine in javascript but noticed its limitations, so I switched to PHP.
All right, here's the problem:
Whatever I try to do, I cannot get file parsing to work!! I need to save the contents of a file (say, example.txt) and save it into $form_namedestn. Here's what I got so far:
I've got a CHMOD 777 on /uploadedfiles and
When I try to run it all, I get nothing: blank page.
I had been trying to do this project of mine in javascript but noticed its limitations, so I switched to PHP.
All right, here's the problem:
Whatever I try to do, I cannot get file parsing to work!! I need to save the contents of a file (say, example.txt) and save it into $form_namedestn. Here's what I got so far:
Code: Select all
if (is_uploaded_file($_FILES['form_name']['tmp_name']) || isset($_POST['form_namedestn'])){
$dir="/myserver/uploadedfiles";
$thisform_namename = $uid."_".$_FILES['form_name']['name'];
$tempfilename = $_FILES['form_name']['tmp_name'];
move_uploaded_file($tempfilename, $dir.'/'.$thisform_namename);
$thisform_namename = $_FILES['form_name']['name'];
$form_namedestn = $_POST['form_namedestn'];
echo $form_namedestn;Code: Select all
<form action="code_above.php" method="POST" name="form_name" enctype="multipart/form-data">
<input name="form_namedesc" type="file">
<br>
<input name="ffile" type="submit" id="form_name" value="Submit File">
</form>