PHP-Code:
	
	
<?php
if ( isset( $text ))
    {
    // Überprüfe Benutzereingaben
    $dberror = "";
    $ret = in_db_einfuegen( $text);
    if ( ! $ret )
        print "Fehler: $dberror<BR>";
    else
        print "<h1>Die News wurden erfolgreich übertragen.</h1>";
    }
else    {
    ausgabe_formular();
    }
function in_db_einfuegen( $text)
    {
    $benutzer = "admin";
    $passwort = "admin";
    $db = "poll";
    $link =  mysql_pconnect( "localhost", $benutzer, $passwort );
    if ( ! $link )
        {
        $dberror = "Keine Verbindung zu MySQL server";
        return false;
        }
    if ( ! mysql_select_db( $db, $link ) )
        {
        $dberror = mysql_error();
        return false;
        }
        echo "<p><font color=\"#CCC1AD\">Neuer Newstext:</font>" ;
        echo "<p>$text</p>";
     $anfrage = "INSERT INTO mypoll ( name, ) 
    values( '$text', )";
    if ( ! mysql_query( $anfrage, $link ) )
        {
        $dberror = mysql_error();
        return false;
        }
    return true;
    }
function ausgabe_formular()
    {
    global $PHP_SELF;
    print "<form action=\"$PHP_SELF\" method=\"POST\">\n";
    print "<p><font color=\"#00CCF0\"><strong>Lehrer einfügen :</strong></font><br>";
    print "<br>";
    print "<input type name=\"text\" cols=\"80\" rows=\"10\"></textarea><br>";
    print "<input type=\"submit\" value=\"Lehrer einfügen\">\n</form>\n";
    }
?>
warum ist doch eigentlich alles richtig oder hab ich was übersehen ?
 
          
 )
 )
							
						
 Moderator
 Moderator
Kommentar