Shoutbox, Problem mit $_POST

So komme ich da nicht weiter!

Es hat das ganze Layout zerrissen und ehrlich gesagt komme ich da auch nicht mehr hinter!
Es hat mit meinem Script gar nichts mehr zu tun und ich vestehe auch die Veränderung nicht mehr.
Es kommen übrigends die gleichen Errors wie ich sie oben schon gepostet hatte.

Gruß Markus

PS: habe hier noch mal das komplette Ausgangsscript, falls es noch was bringt

PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<style>
* {

letter-spacing: 1px;

margin: 0;

padding: 0;

}



body {

padding: 3em;

}



html {

background-image:url(../bilder/bgtheme.jpg);

color: #9B1900;

font: 70%/1.2 sans;

}



fieldset {

background: url(../bilder/bgctheme.jpg);

border: 1px solid #d05a2b;

padding: 10px;

width: 152px;

}



fieldset > legend { /* nur MOSe */

display: block;

}



legend {

background: #d05a2b;

color: #FFF;

display: none;

font-weight: bold;

padding: 3px 6px;

}



label {

display: block;

margin-top: 0;
}



input {

color: #000;

font: 0.6em verdana, arial, helvetica, sans-serif;





width: 150px;


}



input:focus {

background: #ffd1bf;

}



input#registrieren {

display: block;

margin-top: 10px;

padding: 1px 3px;

width: auto;

}
</style>

<html xml:lang="de">

	<head>

		<title>Shoutbox</title>

		<meta http-equiv="content-type" content="text/html; charset=utf-8" />

		<link rel="stylesheet" type="text/css">

	</head>
	


	<body>
	<form action="<?php text(); ?>" method="post" >

            <fieldset>                                     
                <legend>Shoutbox</legend>
                <span style="display:block;font: 0.6em/1.2em sans;width:150px;height:300px;background:#fefefe;">
                <?php
include('db_fns.php');
$handle = db_connect();
$query = "SELECT text FROM shoutbox";
$result = $handle->query($query);

while ($shout = $result->fetch_assoc()) {
$parse_hea =$shout['text']; 
echo "$parse_hea</br>";
echo"<br>";
}
 ?>
</span>

                <label for="name" ></label>

                <input type="text"   name="name" value="Dein Name" onfocus="if (this.value == 'Dein Name') this.value = '';"  />

                <label for="text"></label>

                <input type="text" name="text" value="Dein Text" onfocus="if (this.value == 'Dein Text') this.value = '';"  />
                <label for="mail"></label>

                <input type="text" name="mail" value="Deine email" onfocus="if (this.value == 'Deine email') this.value = '';"/>

                

              <input type="submit" value="registrieren" id="registrieren" />

            </fieldset>

        </form>
<?php             // hier die function zu eintragen in die DB!
function text()
{
$handle = new mysqli('localhost', 'xxx', 'xxx', 'xxx');
    if (!$handle) {
        return FALSE;
    }
    return $handle;


$name = $_POST['name'];
$text = $_POST['text'];
$mail = $_POST['mail'];
$time = time();
 
    $query = "insert into shoutbox
                (name,text,mail,time)
              values
                ('$name', '$text', '$mail', '$time')";          
 
$result = $handle->query($query);

if (!$result) {
    echo "Es gab einen Datenbankfehler beim Ausführen der Abfrage <pre>$query</pre>";
    echo mysqli_error();
    exit;
   }
}

 ?>        
        

    </body>

</html>



EDIT:
Also, ich habs jetzt ans laufen gebracht. Es lag an der
PHP:
mysql_real_escape_string
Function.
Habe sie erstmal rausgenommen und es klappt soweit. Bin mir zwar im Klaren darüber das die Function sinnvoll ist und muß erstmal schauen was ich für Servereinstellungen habe.
Danke dir erstmal für deine intensive Hilfe und schau mal was ich von mache!

Gruß Markus
 
Zuletzt bearbeitet:

Neue Beiträge

Zurück