My code :
<html>
<head>
<title>Untitled Document</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<? if (!$_REQUEST["action"] == 'oplaad') { ?>
<form method="post" enctype="multipart/form-da
ta">
<input type="hidden" name="action" value="oplaad">
<script language="JavaScript">
if (document.all) {
document.write('<input type="file" name="file1" style="display: none;"><input type="text" name="file2"> ');
document.write('<input type="button" id="b_file" value="Browse ..." name="brower" OnClick="document.all.file
1.click();
document.all.file2.value=d
ocument.al
l.file1.va
lue">');
} else {
document.write('<input type="file" name="file1">');
}
</script>
<input type="submit" name="submit" value="oplaad">
</form>
<? }
else {
$userfile = $_REQUEST["file2"]["tmp_na
me"];
$userfile_name = $_REQUEST["file2"]["name"]
;
$userfile_size = $_REQUEST["file2"]["size"]
;
$userfile_type = $_REQUEST["file2"]["type"]
;
echo $userfile. "<br>";
echo $userfile_name. "<br>";
echo $userfile_size. "<br>";
echo $userfile_type. "<br>";
}
?>
</body>
</html>
The javascript i need to layout my file object.
Buth i know to that the problem is in the javascript. Buth i can't seem to find what the problem is...
Help me please.
This code works fine with me :
<html>
<head>
<title>Untitled Document</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<? if (!$_REQUEST["action"] == 'upload') { ?>
<form method="post" enctype="multipart/form-da
ta">
<input type="hidden" name="action" value="upload"> upload file!
<input type="file" name="uf">
<input type="submit" name="submit" value="upload">
</form>
<? }
else {
$userfile = $_REQUEST["uf"]["tmp_name"
];
$userfile_name = $_REQUEST["uf"]["name"];
$userfile_size = $_REQUEST["uf"]["size"];
$userfile_type = $_REQUEST["uf"]["type"];
echo $userfile. "<br>";
echo $userfile_name. "<br>";
echo $userfile_size. "<br>";
echo $userfile_type. "<br>";
}
?>
</body>
</html>
buth i need it to work with the code that has javascript in it.
Slu, Punkie.