Hello,
I am following a tute and trying to get a submission form rolling. Here is the code:
<?php
$file_dir = "C:\wamp\www\MIXPOSURE\mp3";
foreach($_FILES as $file_name => $file_array) {
print "path: ".$file_array['tmp_name']."<br>\n";
print "name: ".$file_array['name']."<br>\n";
print "type: ".$file_array['type']."<br>\n";
print "size: ".$file_array['size']."<br>\n";
if(is_uploaded_file($file_array['tmp_name'])) {
move_uploaded_file($file_array['tmp_name'],
"$file_dir\$file_array['name']") or die ("Couldn't copy");
print "file was moved!!!<br><br>";
}
}
?>
Which produces this:
path: C:\WINDOWS\TEMP\php70.tmp
name: WRENCHFKIT.swf
type: application/x-shockwave-flash
size: 299583
file was moved!!!
The problem is, it doesnt move the file to the mp3 directory but instead it creates a file in the MIXPOSURE directory called mp3$file_array['name'] ?
The tutorial said to list the "$file_dir\$file_array['name']") -line with a forward slash but I used a backslash since its Windows.
Any insight?
Thanks!