Prob wie kan ich es lösen

xamunrax

Erfahrenes Mitglied
Hi,
Ich habe da nen Problem und zwar wenn ich mein PHP script lade hängt er an irgend einer Stelle !

Der code passt leider nicht in einen Thread also habe ich ihn aufgesplitet !!
Hier der Code :

<?

include("lib/db_mysql.inc");

$db = new DB;

include("lib/temp.inc");

$t = new Template;

$t->set_file("main","html/index.htm");
$aslogin = "<form action=\"index.php?logtest=1&SID=$SID\" method=\"post\">
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td width=\"118\" height=\"21\" background=\"../images/bg_menu/login.jpg\">
</TD></TR>
<tr>
<td align=\"center\" width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_1.jpg\">
<FONT SIZE=\"-1\">
&nbsp;
<INPUT TYPE=\"Text\" NAME=\"\" VALUE=\"User Name\" SIZE=\"13\" MAXLENGTH=\"\">
</FONT>
</TD>
</TR>
<tr>
<td align=\"center\" width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_2.jpg\">
<FONT SIZE=\"-1\">
&nbsp;
<INPUT TYPE=\"Password\" NAME=\"\" VALUE=\"Passwort\" SIZE=\"13\" MAXLENGTH=\"\">
</FONT>
</TD>
</TR>
<tr>
<td align=\"center\" width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_3.jpg\">
<FONT SIZE=\"-1\">
<INPUT TYPE=\"Submit\" STYLE=\"background: #5F5F5F; color: #FFFFFF;BORDER: #8F8F8F 1px solid\" NAME=\"Join Us\" VALUE=\"Enter\">
</FONT></TD></TR>
</TABLE>
</form>
<br>
<br>
<center>
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr><td align=\"center\" valign=\"top\"><a href=\"http://www.espl-europe.de\" target=\"_frame\">
<img src=\"../images/Misc%20Links/ESPL_Logo.gif\" border=\"0\" align=\"right\" width=\"88\" height=\"31\"></a>
</TD></TR>
<tr><td align=\"center\" valign=\"top\">
<a href=\"http://www.stammkneipe.de/\" target=\"_blank\">
<img alt=\"stammkneipe.de - Der Treffpunkt für dt. Onlinespieler\" src=\"http://www.stammkneipe.de/bilder/buttons/stammkneipe.gif\" border=\"0\" width=\"88\" height=\"31\">
</a></td></tr>
<tr><td align=\"center\" valign=\"top\">
<a class=\"tableleft_links\" href=\"http://www.daddeln.de\" target=\"_blank\">
<img alt=\"Daddeln.de\" src=\"http://www.daddeln.de/banner/DADDELN.DE-small.jpg\" border=\"0\" align=\"right\" width=\"88\" height=\"31\">
</a></td></tr>
<tr><td align=\"center\" valign=\"top\">
<a title=\"Gamer gegen Terror\" href=\"http://www.gamer-gegen-terror.de/\" target=\"_blank\">
<img src=\"http://www.gamer-gegen-terror.de/pic/ggt-banner02.gif\" border=\"0\" align=\"right\" width=\"81\" height=\"107\">
</a></td></tr>
<tr><td align=\"center\" valign=\"top\"></td></tr>
</TABLE>
</CENTER>";

//Es werden nur Skripte hinzugeladen, die so heißen wie der "mode", der übergeben wird!!
if($mode != "")
{
if(file_exists("Scripts/$mode.inc"))//Prüfen, ob Datei (mode + .inc) existiert -

{

include("Scripts/$mode.inc"); //wenn ja, führe sie aus!

}

else

{
 
Teil 2

header("LOCATION:index.php"); //wenn nein, geh zum Anfang / Anmeldung!

}
}


if ($logtest == "1")
{

echo "test A<br>";

$query = "Select * from members where cnick = '$name' and password = '$pw' ";

$db->query($query);
$db->next_record();
$at = $db->f(cnick);
$bt = $db->f(userlevel);

$anzahl = $db->num_rows();
if($anzahl != "")
{
$query1 = "UPDATE login set user='$at', userlevel = '$bt' WHERE session = '$SID'";
$db->query($query1);
}


}

$query = "Select * from login where session = '$SID' ";
$db->query($query);
$db->next_record();

$ate = $db->f(user);
$bte = $db->f(userlevel);

$query = "Select * from members where cnick = '$ate' and userlevel = '$bte' ";

$db->query($query);

$gert = $db->num_rows();

if($gert == "")
{
$login = $aslogin;
}
elseif ($gert == "1")
{
$db->next_record();



if($bte == "1" || $bte == "2" || $bte == "3")
{
$login = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/ci.jpg\"></TD></TR>
 
TEIL 3

<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_1.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=imassages&SID=$SID\">Messages</A></FONT></TD></TR>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_2.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=inews&SID=$SID\">News</A></FONT></TD></TR>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_3.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=votes&SID=$SID\">Votes</A></TD></FONT></TR>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_4.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=kalender&SID=$SID\">Kalender</A></TD></FONT></TR>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_5.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=taktiken&SID=$SID\">Taktiken</A></TD></FONT></TR>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_6.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=user&SID=$SID\">User-Profil</A></TD></FONT></TR>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_7.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=forum&SID=$SID\">Forum</A></TD></FONT></TR>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_4.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=money&SID=$SID\">Money</A></TD></FONT></TR>
</TABLE>";
}
elseif ($bte == "4")
{
$login = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/ci.jpg\"></TD></TR>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_1.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=imassages&SID=$SID\">Messages</A></FONT></TD></TR>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_2.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=inews&SID=$SID\">News</A></FONT></TD></TR>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_3.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=votes&SID=$SID\">Votes</A></TD></FONT></TR>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_4.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=kalender&SID=$SID\">Kalender</A></TD></FONT></TR>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_5.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=taktiken&SID=$SID\">Taktiken</A></TD></FONT></TR>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_6.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=user&SID=$SID\">User-Profil</A></TD></FONT></TR>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_7.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=forum&SID=$SID\">Forum</A></TD></FONT></TR>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_4.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=money&SID=$SID\">Money</A></TD></FONT></TR>
<tr><td>&nbsp</td></tr>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_2.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=addcw&SID=$SID\">Add ClanWar</A></FONT></TD></TR>
</TABLE>";
}
elseif ($bte == "5")
{
$login = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/ci.jpg\"></TD></TR>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_1.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=imassages&SID=$SID\">Messages</A></FONT></TD></TR>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_2.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=inews&SID=$SID\">News</A></FONT></TD></TR>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_3.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=votes&SID=$SID\">Votes</A></TD></FONT></TR>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_4.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=kalender&SID=$SID\">Kalender</A></TD></FONT></TR>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_5.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=taktiken&SID=$SID\">Taktiken</A></TD></FONT></TR>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_6.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=user&SID=$SID\">User-Profil</A></TD></FONT></TR>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_7.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=forum&SID=$SID\">Forum</A></TD></FONT></TR>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_4.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=money&SID=$SID\">Money</A></TD></FONT></TR>
<tr><td>&nbsp</td></tr>
<tr><td>&nbsp</td></tr>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_2.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=addnews&SID=$SID\">Add News</A></FONT></TD></TR>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_2.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=addinews&SID=$SID\">Add Intern News</A></FONT></TD></TR>
<tr><td>&nbsp</td></tr>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_1.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=addcw&SID=$SID\">Add ClanWar</A></FONT></TD></TR>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_2.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=addcw&SID=$SID\">Add Rules</A></FONT></TD></TR>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_3.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=addcw&SID=$SID\">Add Server Rules</A></FONT></TD></TR>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_4.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=addcw&SID=$SID\">Edit GB</A></FONT></TD></TR>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_5.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=addcw&SID=$SID\">Edit Forum</A></FONT></TD></TR>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_6.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=addcw&SID=$SID\">Add Member</A></FONT></TD></TR>
<tr><td width=\"118\" height=\"21\" background=\"../images/bg_menu/bg_7.jpg\"><FONT SIZE=\"-1\">&nbsp;<A HREF=\"index.php?mode=addcw&SID=$SID\">Add Link</A></FONT></TD></TR>


</TABLE>";
}

}




$query_2 = "SELECT *
FROM count
ORDER BY id DESC" ;
$db->query($query_2);
$count = $db->f(id);


$t->set_var("login",$login);
$t->set_var("count",$count);
$t->parse("main","main");





$t->p("main");



?>
 
LEGENDE

Also hier einige Befehle die Leicht abgeändert wurden :


$db->next_record() = Bleibe in der Zeile (MySQL)
$db->f(); = Lese Spalte (MySQL)

$t->set_file("main","html/index.htm"); // Legt fest welche HTML Datei als Maske geladen werden soll


$t->set_var("count",$count); // Legt den Inhalt des "PlatzHalters" (count) fest.

$t->parse("main","main"); // Schliesst den vorgang ab .
 
Zurück