Haiopei: includes

Beitrag lesen

Ok hier mein Script erstmal ohne includes.......

<?php
$host = "localhost";
$user = "web293";
$pass = "network";
$dbname = "usr_web293_1";
$table = "gb";

$dblink = mysql_connect($host,$user,$pass);
if (!$dblink) {
echo "keine Datenbankverbindung möglich...";
}
else
{
mysql_select_db($table, $dblink);
$alledaten = mysql_query("select * from gb order by eintragsid DESC");
?>
<html>
<head>
<style>
A:link { text-decoration : none; font-family: Verdana,Arial; font-size:10 pt; color:gray;}
A:Visited { text-decoration : none; font-family: Verdana,Arial; font-size:10 pt; color:gray;}
A:Active { text-decoration : none; font-family: Verdana,Arial; font-size:10 pt; color:gray;}
A:Hover { text-decoration : none; font-family: Verdana,Arial; font-size:10 pt; color:black;}
</style>
</head>
<body gbcolor="#F7F4ED">
<center>
<a href="eintragen.php"><img src="eintrag.jpg" border="0"></a>
<?php
while($daten = mysql_fetch_array($alledaten)) {
?>
<table border="2" style=Border-collapse:collapse bordercolor="#D3C1A9" width="80%">
<tr height="10%">
<th width="100%" align="left">Geschrieben von: <a href="mailto:<?php echo $daten["mail"]; ?>"><?php echo $daten["nick"]; ?></a> am: <?php echo $daten["datum"]; ?></th>
</tr>
<tr height="80%">
<th width="100%" align="center"><?php echo $daten["nachricht"]; ?></th>
</tr>
<?php
if ($daten["site"] != "0") {
if ($daten["icq"] != "0") {
?>
<tr height="10%">
<?php
if ($daten["site"] != "0") {
?>
<th width="50%"><a href="<?php echo $daten["site"]; ?>">Page</a></th>
<?php
}
if ($daten["icq"] != "0") {
?>
<th width="50%"><?php echo $daten["icq"]; ?></th>
<?php
}
?>
</tr>
<?php
}
}
?>
</table>
<br><br>
<?php
}
?>
<a href="eintragen.php" border="0"><img scr="eintrag.jpg"></a>
</center>
</body>
</html>
<?php
mysql_close($dblink);
}
?>

Als nächstes mit Includes:

Index.php

<?php
$host = "localhost";
$user = "xxxxxx";
$pass = "xxxxxxx";
$dbname = "usr_web293_1";
$table = "gb";

$dblink = mysql_connect($host,$user,$pass);
if (!$dblink) {
echo "keine Datenbankverbindung möglich...";
}
else
{
include('eintrag.php');
}
?>

eintrag.php

<?php
mysql_select_db($table, $dblink);
$alledaten = mysql_query("select * from ".$table."order by eintragsid DESC");
include('head.php');
while($daten = mysql_fetch_array($alledaten)) {
include('kasten.php');
}
include('bottom.php');
mysql_close($dblink);
?>

head.php

<html>
<head>
<style>
A:link { text-decoration : none; font-family: Verdana,Arial; font-size:10 pt; color:gray;}
A:Visited { text-decoration : none; font-family: Verdana,Arial; font-size:10 pt; color:gray;}
A:Active { text-decoration : none; font-family: Verdana,Arial; font-size:10 pt; color:gray;}
A:Hover { text-decoration : none; font-family: Verdana,Arial; font-size:10 pt; color:black;}
</style>
</head>
<body gbcolor="#F7F4ED">
<center>
<a href="eintragen.php"><img src="eintrag.jpg" border="0"></a>

kasten.php

<table border="2" style=Border-collapse:collapse bordercolor="#D3C1A9" width="80%">
<tr height="10%">
<th width="100%" align="left">Geschrieben von: <a href="mailto:<?php echo $daten["mail"]; ?>"><?php echo $daten["nick"]; ?></a> am: <?php echo $daten["datum"]; ?></th>
</tr>
<tr height="80%">
<th width="100%" align="center"><?php echo $daten["nachricht"]; ?></th>
</tr>
<?php
if ($daten["site"] != "0") {
if ($daten["icq"] != "0") {
include('tabelleunten.php');
}
}
?>
</table>
<br><br>

tabelleunten.php

<tr height="10%">
<?php
if ($daten["site"] != "0") {
?>
<th width="50%"><a href="<?php echo $daten["site"]; ?>">Page</a></th>
<?php
}
if ($daten["icq"] != "0") {
?>
<th width="50%"><?php echo $daten["icq"]; ?></th>
<?php
}
?>
</tr>

bottom.php

<a href="eintragen.php" border="0"><img scr="eintrag.jpg"></a>
</center>
</body>
</html>

So das wart jetzt sehr übersichtlich....sorry

Danke für die schnelle Hilfe
Haiopei