upload der renamer til det skrevende
Dette ville jeg gerne have gjorder at det rename mit pic til det jeg skriver i "ditfilnavn" og så uploader det...<?php
if($_POST['up']){
$files = $_FILES['upfil']['name'];
$file = $_FILES['upfil']['tmp_name'];
$sti = "---min sti---";
$temparr = explode(".", $files);
$temparr[count($temparr)-2] = time();
$files = implode(".", $temparr);
move_uploaded_file($file, $sti . $files);
mail("kim@gex.dk, webmaster@gex.dk", "Pic uploadet..", "Submit:\nName: $_POST[navn]\nE-Mail:$_POST[mail]\nURL::$_POST[url]\nDescription:$_POST[description]\nGategory:$_POST[gategory]\nPic name: http://www.gex.dk/script/upload2/thumb/$files", "From: $_POST[navn] <$_POST[mail]>");
echo "<center><font color='red'><h3>Your fil is uploaded</h3></font></center><br><br>";
include ("db.php");
mysql_query("INSERT INTO erotgp_teens_tgp (ditfilnavn, filnavn)
VALUES ('$ditfilnavn','$files')");
}
?>
<form action="index.php" method="post" enctype="multipart/form-data">
<br />
<br />
<br />
<div align="center">
<center>
<table border="1" width="70%" bordercolor="#000000" cellspacing cellpadding bgcolor="#FFFFCC">
<tr>
<td width="100%">
<div align="center">
<table width="90%" cellspacing cellpadding>
<tr>
<td width="100%"><center>
<table border="0" width="103%" cellspacing="3" cellpadding="3">
<tr>
<td width="32%"><b>Dit filnavn:</b></td>
<td width="5%"></td>
<td width="67%">
<input type="text" name="ditfilnavn">
</td><tr>
<tr> <td width="32%"><b>Upload <br>
(Jpg, 88x88 pixels):</b></td>
<td width="5%"></td>
<td width="67%">
<input type="file" name="upfil" value="">
</td>
</tr>
<tr>
<td width="32%"></td>
<td width="5%"></td>
<td width="67%">
<input type="submit" value="Submit" name="up">
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>
</form>
