ERLEDIGT
NEIN
NEIN
ANTWORTEN
6
6
ZUGRIFFE
307
307
EMPFEHLEN
-
Hallo
ich möchte gerne
eine datei auf den webspace uploaden undzwar in den wallpapers ordner und danach soll der genau link in der mysql datenbank abgespeichert werden aber das geht irgendwie nicht
PHP-Code:<?php
include '../functions.inc.php';
connect_db();
if ($action == "new") {
$path_to_file = "wallpapers/";
$location = $path_to_file.$uploadfile_name;
copy($uploadfile,$location);
$wallpapers = mysql_query("INSERT INTO sth_wallpapers ( $uploadfile_name ) values ( '$uploadfile_name' )");
if ($wallpapers) {
echo "eintrag erfolgreich";
} else {
echo mysql_errno() . ": " . mysql_error() . "\n";
}
}
?>
-
also das hochladen geht hab ich gerade festgestellt aba net das eintragen in die datenbank :[ *schnief*
-
19.08.02 22:07 #3
- Registriert seit
- Jan 2002
- Ort
- Betelgeuse
- Beiträge
- 709
die spalte in deiner daten bank hat doch nicht den namen $uploadfile_name, oder? wenn das doch so ist, dann solltest du \$uploadfile_name schreiben, ansonsten wird das nämlich im string ersetzt.$wallpapers = mysql_query("INSERT INTO sth_wallpapers ( $uploadfile_name ) values ( '$uploadfile_name' )");
eben ein nachteil der " - strings.
been there, done that, lived it, left it
-
Ja ich depp, hab absolut nicht nachgedacht
so gehts ;>PHP-Code:if ($action == "new") {
$path_to_file = "../wallpapers/";
$location = $path_to_file.$uploadfile_name;
copy($uploadfile,$location);
$wallpapers = mysql_query("INSERT INTO sth_wallpapers ( wallpaper_path, wallpaper_name ) values ( '$path_to_file', '$uploadfile_name')");
if ($wallpapers) {
echo "eintrag erfolgreich";
} else {
echo mysql_errno() . ": " . mysql_error() . "\n";
}
}
-
19.08.02 22:15 #5
- Registriert seit
- Jan 2002
- Ort
- Betelgeuse
- Beiträge
- 709
manchmal stolpert das genie beim laufen.
been there, done that, lived it, left it
-
stimmt :>
aber dazu fällt mir keine lösung ein
hab hin und her probiert
ich will jetzt den phat und dateinamen dazu verwenden das jetzt nen bild dargestellt wird aber irgendwie geht das net :[
und so stehts in der datenbankPHP-Code:<?
$result = mysql_query("SELECT * FROM sth_wallpapers ORDER BY id");
while($wallpapers = mysql_fetch_array($result))
{
?>
<td>
<?php echo "<div align='center'><img src='$wallpapers[wallpapers_phat]/$wallpapers[wallpapers_name]' width='272' height='217'></div>"; ?>
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</td>
<td width="5"></td>
<tr>
<td width="459" height="5" colspan="3"></td>
</tr>
</table>
</td>
</tr>
</table>
<?php } ?>
Code :1 2
[U]id wallpaper_path wallpaper_name [/U] 2 wallpapers dod_zafod0004.jpg
-
wenn du $wallpapers[wallpapers_phat] durch $wallpapers[wallpapers_path] wird es dann hoffentlich klappen
Have a nice day!
Ähnliche Themen
-
Problem bei upload script
Von whiterussian im Forum PHPAntworten: 2Letzter Beitrag: 19.03.09, 13:05 -
Upload Script Problem
Von reyjr im Forum PHPAntworten: 12Letzter Beitrag: 18.10.05, 19:09 -
Problem mit Upload Script
Von mtk-flo im Forum PHPAntworten: 4Letzter Beitrag: 13.07.05, 15:21 -
Problem mit Upload-Script
Von sreinhardt im Forum PHPAntworten: 5Letzter Beitrag: 13.04.05, 14:35 -
Problem mit upload script
Von visionsign im Forum PHPAntworten: 3Letzter Beitrag: 03.11.04, 10:06





Zitieren
Login






[PHP][Snippet] Array zu XML konvertieren