- Beranda
- Website, Webmaster, Webdeveloper
[HELP] cara membuat allow extension di php uploader image [CENDOL INSIDE]
...
TS
LegendFrozen
[HELP] cara membuat allow extension di php uploader image [CENDOL INSIDE]
gan ane kan bikin web uploader image.
kalau cuma mau allow extensi jpg , png gimana ya
jadi selain extensi yang di allow , gk bisa upload
nih php ane
yg bisa bantu fix , dapet cendol
kalau cuma mau allow extensi jpg , png gimana ya
jadi selain extensi yang di allow , gk bisa upload
nih php ane
Code:
<h1>SB Upload</h1>
<hr>
<style type="text/css">
#wrap{
margin-left:auto;
margin-right:auto;
margin-top:5%;
width:320px;
box-shadow:0 0 5px #000;
padding:5px;
}
#page{
font-size:14;
margin-top:5px;
}
#header{
font-size:25;
border-bottom:0.9px dotted silver;
}
a{
color:blue;
text-decoration:none;
}
a:hover{
color:red;
}
textarea{
width:400px;
height:100px;
}
</style>
</head>
<body>
<style>
input {
border: 5px solid red;
-webkit-box-shadow:
inset 0 0 8px rgba(0,0,0,0.1),
0 0 16px rgba(0,0,0,0.1);
-moz-box-shadow:
inset 0 0 10px rgba(0,0,0,0.1),
0 0 20px rgba(0,0,0,0.1);
box-shadow:
inset 0 0 8px rgba(0,0,0,0.1),
0 0 16px rgba(0,0,0,0.1);
padding: 15px;
background: rgba(255,255,255,0.5);
margin: 0 0 10px 0;
width:300px;
height:50px;
}
</style>
<div id='wrap'>
<?php
mysql_connect("localhost","sbsamz_sl","pass");
mysql_select_db("sbsamz_upload");
function upload($filename){
/* pertama-tama filtering nama file */
// ganti spasi dengan garis bawah
$filter1st = str_replace(" ","_",$filename['name']);
// tambahkan nama dengan angka random didepan (atau dibelakang, tergantung kesukaan)
$filter2nd = rand(10000,999990).$filter1st;
if(move_uploaded_file($filename['tmp_name'],"/home/sbsamz/public_html/img/img/".$filter2nd)/;)/{
// jika upload data berhasil, baru masukkan informasi file kedalam database
mysql_query("INSERT INTO `tbl_data` VALUES (NULL , '".$filter2nd."');");
$msg = "Upload Telah berhasil!";
echo "<textarea>http://" .$_SERVER['HTTP_HOST']."/img/img/".$filter2nd."</textarea>";
} else {
// jika gagal
$msg = "File gagal diunggah";
}
echo $msg;
}
echo "<form name='f' method='post' action='' enctype='multipart/form-data'>
<center><input type='file' name='filenya'></center>
<center><input type='submit' class='classname' name='submit' value='Upload'></center>
</form>";
if(isset($_POST['submit']))upload($_FILES['filenya']);
?>
<style type="text/css">
.classname {
-moz-box-shadow:inset 0px 1px 0px 0px #ffffff;
-webkit-box-shadow:inset 0px 1px 0px 0px #ffffff;
box-shadow:inset 0px 1px 0px 0px #ffffff;
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #dfdfdf) );
background:-moz-linear-gradient( center top, #ededed 5%, #dfdfdf 100% );
filter/:p/rogid/:D/XImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#dfdfdf');
background-color:#ededed;
-moz-border-radius:6px;
-webkit-border-radius:6px;
border-radius:6px;
border:1px solid #dcdcdc;
display:inline-block;
color:#777777;
font-family:arial;
font-size:15px;
font-weight:bold;
padding:6px 24px;
text-decoration:none;
text-shadow:1px 1px 0px #ffffff;
}.classname:hover {
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #dfdfdf), color-stop(1, #ededed) );
background:-moz-linear-gradient( center top, #dfdfdf 5%, #ededed 100% );
filter/:p/rogid/:D/XImageTransform.Microsoft.gradient(startColorstr='#dfdfdf', endColorstr='#ededed');
background-color:#dfdfdf;
}.classname:active {
position:relative;
top:1px;
}
/* This imageless css button was generated by CSSButtonGenerator.com */
</style>
</div>
</div>
</body>
<title>SB Upload</title>
<body bgcolor="#F5F5DC">
<hr>
<style type="text/css">
#wrap{
margin-left:auto;
margin-right:auto;
margin-top:5%;
width:320px;
box-shadow:0 0 5px #000;
padding:5px;
}
#page{
font-size:14;
margin-top:5px;
}
#header{
font-size:25;
border-bottom:0.9px dotted silver;
}
a{
color:blue;
text-decoration:none;
}
a:hover{
color:red;
}
textarea{
width:305px;
height:100px;
}
</style>
</head>
<body>
<div id='wrap'>
<div id='header'><center>Stats</center></div>
<div id='page'>
<center><!-- Histats.com START (standard)-->
[removed][removed](unescape("%3Cscript src=%27http://s10.histats.com/js15.js%27 type=%27text/javascript%27%3E%3C/script%3E"));[removed]
<a href="http://www.histats.com" target="_blank" title="website tracking">[removed]
try {Histats.start(1,2211026,4,403,118,80,"00011111");
Histats.track_hits();} catch(err){};
[removed]</a>
<noscript><a href="http://www.histats.com" target="_blank"><img src="http://sstatic1.histats.com/0.gif?2211026&101" alt="website tracking" border="0"></a></noscript>
<!-- Histats.com END -->
</center>
</div>
</div>
</body>
<hr>
<center>Copyright @ 2013 SBUpload</center>
<hr>
yg bisa bantu fix , dapet cendol
0
976
4
Guest
Tulis komentar menarik atau mention replykgpt untuk ngobrol seru
Mari bergabung, dapatkan informasi dan teman baru!
Website, Webmaster, Webdeveloper
23.3KThread•4.4KAnggota
Terlama
Guest
Tulis komentar menarik atau mention replykgpt untuk ngobrol seru