Evo ovako , treba mi mala pomoc oko scripte… Dakle sve normalno radi , sa nicim nemam problema , samo mi se ne svida jedna stvar sto url slike bude pre velik… Ja bi htio da bude manji… Pa ako tko ima volje pomoci , sta bi trebao promjeniti u scripti, Evo scripta:
<div id="content-wrap">
<div id="main">
<center>
<?php
include('config.php');
if($_SERVER['REQUEST_METHOD'] == 'POST') {
preg_match('/\.([a-zA-Z]+?)$/', $_FILES['file']['name'], $matches);
if(in_array(strtolower($matches[1]), $accepted)) {
if($_FILES['file']['size'] <= $maxsize) {
$newname = md5_file($_FILES['file']['tmp_name']).'.'.$matches[1];
move_uploaded_file($_FILES['file']['tmp_name'], $filedir.'/'.$newname);
$linkurl = 'http://'.$_SERVER['HTTP_HOST'].preg_replace('/\/([^\/]+?)$/', '/', $_SERVER['PHP_SELF']).'#'.$newname;
$imgurl = 'http://'.$_SERVER['HTTP_HOST'].preg_replace('/\/([^\/]+?)$/', '/', $_SERVER['PHP_SELF']).$filedir.'/'.$newname;
$alt = $_POST["alt"];
print '<h2>Picture Uploaded Successfuly!!!!</h2> <p id="codes">
<img src="'.$imgurl.'" height="300" alt="Uploaded Picture" >
<label for="codebb">BBCode:</label>
<input type="text" id="codebb" value="[URL='.$siteurl.'][IMG]'.$imgurl.'[/IMG][/URL]" onclick="javascript:this.focus();this.select();" readonly="true" /><br />
<label for="codehtml">HTML Code: </label>
<input type="text" id="codehtml" value=\'<a href="'.$siteurl.'"><img src="'.$imgurl.'" alt="'.$alt.'" /></a>\' onclick="javascript:this.focus();this.select();" readonly="true" /><br />
<label for="codedirect">Direct Link:</label>
<input type="text" id="codedirect" value="'.$imgurl.'" onclick="javascript:this.focus();this.select();" readonly="true" /></p>';
} else
print '<p>Sorry, Max Picture size is 10Mb</p>';
} else
print '<p>Sorry, Filetype Not Allowed</p>';
}
?>
</center>
<center>
<form enctype="multipart/form-data" action="<?php print preg_replace('/\/([^\/]+?)$/', '/', $_SERVER['PHP_SELF']) ?>" method="post">
<label for="file">Picture Upload: </label><input type="file" name="file" id="file" />(Max Pic. Size is 10MB)<br />
<label for="alt">ALT Text:</label><input type="text" name="alt" id="alt" /><br><br>
<input name="submit" type="submit" value="Upload Picture...." class="button">
</form>
</center>
<?
$page = $_GET['p'];
if ($page == Null)
{
}
else if ($page == contact)
include("contact.php");
else
{
echo "<center><b><h1>are u tryng to h4x0r or something ? :D</h1></b></center>";
}
?>
</div>