Computer Hardware Forum - TweakPC

Computer Hardware Forum - TweakPC (https://www.tweakpc.de/forum/)
-   Programmiersprachen (https://www.tweakpc.de/forum/programmiersprachen/)
-   -   Speichern wird ignoriert (https://www.tweakpc.de/forum/programmiersprachen/39368-speichern-wird-ignoriert.html)

mokus 08.08.2006 13:44

Speichern wird ignoriert
 
HI
sitze seit einem tag an einen Problem in einem Speicher Script, was ich geschrieben habe. Das Problem ist so, dass er nix in die
Datenbank rein schreibt und wenn ich jetzt zum Beispiel beim Insert Into einen fehler reinmache, kommt keine fehlermeldung,
sozusagen ignoriert das Script die Msql Sachen.

Hier macht er nix:
[php]
<?php
if($_REQUEST['videouploadsend'] )
{
if($_FILES['videodatei']['tmp_name']){
$zufall = rand(1,90000);
$_FILES2['videodatei'] = str_replace(" ","_",$_FILES['videodatei'] ) ;
$_FILES2['bilddatei'] = str_replace(" ","_",$_FILES['bilddatei'] ) ;
$videoinfo = $_POST["videoupload"];
$videotitel = $_POST["titel"];
$videobild = $_POST["videobild"];
if ($videoinfo==""){
echo"<font face=arial size=2>Bitte geben sie einen Kategorie an.&nbsp;<a class=Schrift_Link_1 href=index.php?{$_SERVER["QUERY_STRING"]}><b>Zurück</b></a></font>
</td></tr>
<tr><td style='border: solid 1px #000000; background-color: #FDCA00;' width=550 align=center>";
}else{
if ("no"==$videobild) {
echo "Speichern";
$videobild="no_picture.gif";
$upload = "INSERT INTO `funvideo` (`adresse` , `dateinamevideo` , `kategorie`, `dateinamevideo`, `uploadautor`, `dateinamebild` , `titel`)
VALUES ('$uploadvideopfad$videoinfo/' , '$zufall{$_FILES2['videodatei']['name']}' , '$videoinfo', '$videotitel', '$nameprue', '$videobild', '$videotitel')";
$upload = mysql_query($upload);
move_uploaded_file($_FILES2['videodatei']['tmp_name'], $uploadvideopfad.$videoinfo.'/'.$zufall.$_FILES2['videodatei']['name']);
echo "<meta http-equiv=refresh content=0;URL=index.php?{$_SERVER["QUERY_STRING"]}>";
}
else
{
echo "Speichern";
$upload = "INSERT INTO `funvideo` (`adresse` , `dateinamevideo` , `kategorie`, `dateinamevideo`, `uploadautor`, `dateinamebild` , `titel`)
VALUES ('$uploadvideopfad$videoinfo/' , '$zufall{$_FILES2['videodatei']['name']}' , '$videoinfo', '$videotitel', '$nameprue', '$zufall{$_FILES2['bilddatei']['name']}', '$videotitel')";
$upload = mysql_query($upload);
move_uploaded_file($_FILES2['bilddatei']['tmp_name'], $uploadvideopfad.$videoinfo.'/'.$zufall.$_FILES2['bilddatei']['name']);
move_uploaded_file($_FILES2['videodatei']['tmp_name'], $uploadvideopfad.$videoinfo.'/'.$zufall.$_FILES2['videodatei']['name']);
}

}
}
else
{
echo"<font face=arial size=2>Bitte geben Sie eine Datei an!&nbsp;<a class=Schrift_Link_1 href=index.php?{$_SERVER["QUERY_STRING"]}><b>Zurück</b></a></font>
</td></tr>
<tr><td style='border: solid 1px #000000; background-color: #FDCA00;' width=550 align=center>";
}

}
?>
[/php]

BenniG. 09.08.2006 16:18

AW: Speichern wird ignoriert
 
ini_set("display_errors",1);
error_reporting(E_ALL);

an den scriptanfang schreiben..
du machst keine mysql-verbindung auf und selektierst auch keine datenbank..
falls magic_quotes aus sind hast du außerdem ein problem mit sql-injection, also solltest du mysql_real_escape_string benutzen..

zum nachschlagen:
[URL="http://de.php.net/mysql_connect"]http://de.php.net/mysql_connect[/URL]
[URL="http://de.php.net/manual/de/function.mysql-select-db.php"]http://de.php.net/manual/de/function.mysql-select-db.php[/URL]
[URL="http://de.php.net/manual/de/function.mysql-real-escape-string.php"]http://de.php.net/manual/de/function.mysql-real-escape-string.php[/URL]
[URL="http://de.php.net/manual/de/function.get-magic-quotes-gpc.php"]http://de.php.net/manual/de/function.get-magic-quotes-gpc.php[/URL]
[url]http://de.wikipedia.org/wiki/SQL_Injection[/url] (dort quotesqlvar mal anschauen)


Alle Zeitangaben in WEZ +1. Es ist jetzt 04:52 Uhr.

Powered by vBulletin® Version 3.8.10 (Deutsch)
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
SEO by vBSEO 3.5.2 ©2010, Crawlability, Inc.