Nu jag säkert stans största n00b innom php.
men jag försöker göra så att man lätt ska kunna ladda upp en fil till en katalog i windows... har gjort 2 php filer
fil 1:
<?php
//User_Upload.php
include "User_Upload_Functions.php";
$upload_success ='';
// RUNS THE UPLOAD FUNCTION
User_Upload_Function();
// SHOWS THE UPLOAD FORM
User_Upload_Form();
global $upload_success;
echo $upload_success;
?>
och fil 2:
<?php
//User_Upload_Functions.php
// RUNS THE UPLOAD FUNCTION
function User_Upload_Function()
{
global $upload_success;
if (isset($\_POST\["upload"\]))
{
copy($\_POST\["file"\], "C:\\Inetpub\\wwwroot\\php\\jolle\\upload\\$\_POST\['file'\]") or die ("Couldn´t copy");
$upload_success = "Uppladdningen lyckades!!";
}
}
// SHOWS THE UPLOAD FORM
function User_Upload_Form()
{
<?php
function User_Upload_Function()
{
global $upload_success;
if (isset($_POST['upload']))
{
copy($_FILES['file']['tmp_name'], "C:\Inetpub\wwwroot\php\jolle\upload\".$_FILES['file']['name']) or die ("Couldn´t copy");
$upload_success = "Uppladdningen lyckades!!";
}
}
?>