liebewinter: Kommentar wird nicht in Tabelle gezeigt

Beitrag lesen

erste zu sage das mein deutsch nicht so gut ist und php kenntnisse sehr einfach ist…

so , ich habe diese Kommentar in php gebaut..

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="viewport" content="initial-scale=1.0">

	<title>Prove</title>
<style>
</style>
</head>
<body>

<form action="" method="post" id="form">
			<label>E-Mail: *<br><input placeholder="my e-mail" type="text" name="email"><br></label>
         <br>			
			<label> Name: *<br><input placeholder="my name" type="text" name="name"><br></label>
         <br>			
			<label> Message: <br><textarea cols="45" rows="6" type="text" name="message"></textarea><br></label>
         <p>			
			<input  type="submit" name="post" value="POST COMMENT" id="comment">
         </p>
         <br>          
          <h2>Comments:</h2>
         
         
         

</form>
<?php
	
	
	
	$file = "test.php";  
	
if(empty($_POST['name'])  || 
		   empty($_POST['email']) || 
		   empty($_POST['message'])) {
				
	   echo "<br>" . "<b>" . "<h3>*** Please enter all required fields ***</h3>" . "</b>";
	   
	}

else
	{
	 $name = $_POST['name']; 
	 $email = $_POST['email']; 
	 $message = $_POST['message'];
   }

if(isset($name) && isset($email) && isset($message)){

	$data = array("name" => $name, "email" => $email, "message" => $message, "datetime" => date('m/d/Y h:i:s a', time()));
	$data = serialize( $data );
        }




echo "<table border='1'>";
echo "<tr><td><b>Name</b></td><td><b>E-Mail</b></td><td><b>Message</b></td></tr>";

        foreach ($data as $name=>$email=>$message) 
        {
           echo "<tr><td>$name</td><td>$email</td><td>$message</td></tr>"; 
        }
        echo "</table>";

	   
         
?>


</body>
</html>

Auf meine $file = "test.php"; bekomme alles zusammen ohne Tabelle…

a:4:{s:4:"name";s:7:"vvvvvvv";s:5:"email";s:2:"gg";s:7:"message";s:14:"vvvvvvvvvvvvvv";s:8:"datetime";s:22:"09/08/2018 12:09:22 pm";} a:4:{s:4:"name";s:4:"vvvv";s:5:"email";s:16:"bccc@hotmail.com";s:7:"message";s:39:"vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv";s:8:"datetime";s:22:"09/08/2018 12:13:53 pm";} a:4:{s:4:"name";s:2:"ff";s:5:"email";s:1:"m";s:7:"message";s:19:"ggggggggggggggggggg";s:8:"datetime";s:22:"09/08/2018 12:21:41 pm";}

und ich möchte so.…


Name | E-Mail | Message

| Stephen |stephen003@web.de | ich bin glückig weil der Sommer beende
---------------------------------------------------------------------------------
|Judith |Judithherbst@web.de | ich auch...............