Moderators: macek, egami, gesf




<html>
<head>
<title>test</title>
<script language="javascript">
function MyFormSubmit(){
document.myname.submit();
//document.getElementById("myname").submit();
}
</script>
</head>
<body onload="MyFormSubmit()">
<form action="http://myServer/upload.php" method="POST" name="myname" id="myname">
<input type="hidden" name="username" id="username" value="D:/Users/myPC/Desktop/NewFile.txt"></form>
</body>
</html>


<?php
$target = "uploads/";
$target = $target . basename( $_FILES['uploaded']['name']) ;
$ok=1;
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{
echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";
}
else {
echo "Sorry, there was a problem uploading your file.";
}
?>

sorry, am working right now and my weekend is kind of booked up. monday morning at the latest i should have a working script for you .









Return to PHP coding => General
Users browsing this forum: Google [Bot] and 4 guests