Bildnamen in DB schreiben

tesarolle

Mitglied
Bei meinem Quellcode ist die variable $nom der Benutzername den man eingeben kann und $bild ist ebenfalls ein textfeld in das der name des bildes reinkommen soll das hochgeladen wird.

Dsa ganze funktioniert aber leider nicht! Wie muss ich die variable $bild belegen damit diese den wert des hochgeladenen bildes bekommt?


PHP:
<html>
<head><title>PHP workshop for form management: ajoutimp.php</title><head>
<body>

<?php

$nom=$_POST['nom'];
$bild=$_POST['bild'];
$ip=$_SERVER["REMOTE_ADDR"];
$host=gethostbyaddr($ip);


include_once("includes/connect.php"); 

 

$sql = "INSERT INTO datensatz ( nom bild, date, time, ip, host)
VALUES ('$nom', $bild, now(), now(), '$ip', '$host')";
mysql_query($sql, $db) or die (mysql_error());


include ("upload.php"); 


print("                   VIELEN DANK FÜR IHRE EINGABEN                    ") ;

//include ("ALLE_BILDER_EINES_ORDNERS_ANZEIGEN_in_orig-Groesse.php");

?>

</body>
</html>
 
Habe meinen Quellcode geändert:

PHP:
<html>
<head><title>PHP workshop for form management: ajoutimp.php</title><head>
<body>

<?php

$nom=$_POST['nom'];
$bild=$_FILES['bild']['name'];
$ip=$_SERVER["REMOTE_ADDR"];
$host=gethostbyaddr($ip);


include_once("includes/connect.php"); 

 

$sql = "INSERT INTO datensatz ( nom, bild, date, time, ip, host)
VALUES ('$nom', $bild, now(), now(), '$ip', '$host')";
mysql_query($sql, $db) or die (mysql_error());


include ("upload.php"); 


print("                   VIELEN DANK FÜR IHRE EINGABEN                    ") ;

//include ("ALLE_BILDER_EINES_ORDNERS_ANZEIGEN_in_orig-Groesse.php");

?>

</body>
</html>



FUNKTIONIERT ABER LEIDER IMMER NOCH NICHT (:-


Notice: Undefined index: bild in c:\programme\easyphp1-7\www\test\daten_checken.php on line 8
Fehler in der Syntax bei ' now(), now(), '10.1.11.141', 'org280')' in Zeile 2.
 
Zurück