Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

PHP generierter HTML Code macht Fehler

Empfohlene Antworten

Veröffentlicht

Moin zusammen

Ich weiss nicht ob das hierher gehört, oder ob das eher in HTML gehört... naja egal.

ALso ich habe einen PHP generierten HTML Code... 2 Tabellen.

aber irgendwie stellt der die nebeneinander dar, und nicht wie gewohnt untereinander. Ich habe "<p> </p>", "<br>" und "\n" versucht

bei <br> hat er die andere tabelle einen satz teiefer angezeit aber immernoch nebeneinander...???

Da ist sicher ein denkfehlrer drin, abe rich finde ihn einfach nicht

Hier mal der HTML Code:


<!doctype html public "-//W3C//DTD HTML 4.0 //EN">

<html>

<head>

       <title> Kontakt Anzeigen</title>

       <link rel="stylesheet" type="text/css" href="style.css">

</head>


<body>

<h2 align="center">Michael der Tohoma</h2>

<p>

<table border=1 width='90%' align='left' cellspacing=15>

       <tr>

	       <th align='right'> Vorname: </th>

	       <td> Michael </td>

       </tr>

       <tr>

	       <th align='right'> Nachname: </th>

	       <td> der Tohoma </td>

       </tr>

       <tr>

	       <th align='right' valign='top'> Info: </th>

	       <td>    Das bin ich <br />glaube ich selber<br />ss </td>

       </tr>

</table>

</p>

<br>

<table border=1 width='90%' align='left' cellspacing=15> 

	<tr>

	       <th align='right'> Nummer: </th>

	       <td> 02641 5146 </td>

       </tr>

       <tr>

	       <th align='right' valign='top'> Info: </th>

	       <td> Telefon Privat </td>

       </tr> <tr>

	       <th align='right'> Nummer: </th>

	       <td> 0175 </td>

       </tr>

       <tr>

	       <th align='right' valign='top'> Info: </th>

	       <td>  </td>

       </tr></table>

</body>

</html>

Und hier mal der PHP:

<?

  include("_connect.php");

  $abfr="SELECT * FROM kontakt WHERE pers_id=$pers_id";

  $ergebnis= mysql_query($abfr);

while($row = mysql_fetch_object($ergebnis))

  {


?>

<!doctype html public "-//W3C//DTD HTML 4.0 //EN">

<html>

<head>

       <title> Kontakt Anzeigen</title>

       <link rel="stylesheet" type="text/css" href="style.css">

</head>


<body>

<h2 align="center"><? echo "$row->vorname" . " " . "$row->nachname"; ?></h2>

<?


  echo "<table border='1' width='90%' align='left' cellspacing='15'>

       <tr>

       <th align='right'> Vorname: </th>

       <td> $row->vorname </td>

       </tr>

       <tr>

       <th align='right'> Nachname: </th>

       <td> $row->nachname </td>

       </tr>

       <tr>

       <th align='right' valign='top'> Info: </th>

       <td> ". nl2br($row->info) ." </td>

       </tr>

       </table>\n";

  $abfrTele="SELECT * FROM telefon WHERE pers_id = $pers_id";

  $ergebnisTele= mysql_query($abfrTele);

  echo "<table border='1' width='90%' align='left' cellspacing='15'>";

  while($rowTele = mysql_fetch_object($ergebnisTele))

   {

   echo" <tr>

       <th align='right'> Nummer: </th>

       <td> $rowTele->nummer </td>

       </tr>

       <tr>

       <th align='right' valign='top'> Info: </th>

       <td> ". nl2br($rowTele->info) ." </td>

       </tr>";


   }

   echo "</table>";

  }

?>


</body>

</html>

P.S.: kann es sei das das "PHP Code" Button noch net so gaz funtzt oder war ich da auch nur wieder zu doof für?"

Nimm einfach mal align='left' aus den table-Tags. Wenn nichts angegeben ist, wird sowieso alles linksbündig gesetzt.

*grummelt*

ich hasse es wenn man so kleinigkeiten nicht sieht. naja eigentlich war es ja ncht umgedingt falsch ;D

aber es geht nun

danke!

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.