1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
|
<html>
<head></head>
<body bgcolor='#cccccc'>
<?php
require("./global.php");
$wahl = $wbbuserdata['username'];
echo "<center>".$wahl;
/*
echo '<pre>';
print_r($_FILES);
echo '</pre>';
Das array $_FILES liefert folgende Werte:
[name] => 010[1].jpg
[type] => image/jpeg
[tmp_name] => /tmp/php2D9stm
[error] => 0
[size] => 3188
*/
echo '<hr/>';
if (isset($_FILES['bild'])){
$datei = $_FILES['bild'];
if ($datei['type'] == 'image/jpeg' || $datei['type'] == 'image/jpg' || $datei['type'] == 'image/gif'){
copy($datei['tmp_name'], 'images/'.'signatur/' .$datei['name']);
$neu = "UPDATE bb1_users SET signature = '[img]images/signatur/{$datei['name']}[/img]' WHERE username = '$wahl'";
$tab = mysql_query($neu);
echo mysql_error();
echo "<img src='images/signatur/{$datei['name']}' width='200' />";
echo "<br><br>Link zum Bild: images/signatur/".$datei['name'];
}else{
echo 'Nur Bilder im Format jpeg, jpg und gif erlaubt!';
}
}else{
echo '<em>Kein Bild gewählt</em>';
}
?>
<hr/>
<form method="post" enctype="multipart/form-data">
<input name='bild' type="file" /><br/>
<input type="submit" value='Bild hochladen'>
</form>
<br><br>
<tr><h3 colspan="7"><a href="usercp.php?action=signature_edit">Zurück zum Board! </a></center></h3></tr></center>
</body>
</html> |