wezze Posted June 3, 2012 Share Posted June 3, 2012 I have a login script from the internet i modified some stuff when not logged in the page shows like it should but when logged in it skips some html code any ideas? http://mcbevers.be/login/index.php user test1 pass test CODE <? include("include/session.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>Mc Bevers home</title> <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen"/> <!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]--> <!--<link rel="stylesheet" type="text/css" href="css/styles.css" />--> <!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" src="script.js"></script>--> </head> <body> <div id="wrapper"> <nav> <ul class="lang"> <li><a href="../indexnl.html" class="nl">Nl</a></li> <li class="last"><a href="../indexfr.html" class="fr">Fr</a></li> </ul> <ul class="menu"> <li><a class="active" title="home" href="../indexnl.html">Home</a></li> <li><a title="Leden" href="../ledennlp1.html">Leden</a></li> <li><a title="Album" href="../albumnl.html">Album</a></li> <li><a title="Kalender" href="../kalendernl.html">Kalender</a></li> <li><a title="Contact" href="../contactnl.html">Contact</a></li> </ul> </nav> <header> <h1><a title="html5 template" href="../index.html">Mc Bevers</a></h1> </header> <section id="main" class="clearfix"> <section id="content"> <article> <? /** * User has already logged in, so display relavent links, including * a link to the admin center if the user is an administrator. */ if($session->logged_in){ echo '<h1><img src="images/lock_unlocked.png" width="32" height="32">Logged In</h1>'; echo "<table width='600' cellpadding='5' cellspacing='5' border='1'>"; echo "<p>Welcome <b>$session->username</b></p> <br/><br/>" ."<tr><td>[<a href=\"userinfo.php?user=$session->username\">My Account</a>]</td></tr>" ."<tr><td>[<a href=\"useredit.php\">Edit Account</a>]</td></tr>"; if($session->isAdmin()){ echo "<tr><td>[<a href=\"admin/admin.php\">Admin Center</a>]</td></tr>"; echo "<tr><td>[<a href=\"../gastenboek/admin/index.php\">Gastenboek</a>]</td></tr>"; echo "<tr><td>[<a href=\"../livre d'or/admin/index.php\">livre d'or</a>]</td></tr>"; echo "<tr><td>[<a href=\"../upload/upload.form.php\">upload</a>]</td></tr>"; } echo "<tr><td>[<a href=\"process.php\">Logout</a>]</td></tr>"; } else{ ?> <? /** * User not logged in, display the login form. * If user has already tried to login, but errors were * found, display the total number of errors. * If errors occurred, they will be displayed. */ if($form->num_errors > 0){ echo "<p><font size=\"2\">".$form->num_errors." error(s) found</font></p>"; } ?> <section id="form1"> <h3>Login</h3> <form action="process.php" method="post"> <p><label>Gebruikers naam</label></p> <input type="text" name="user" maxlength="30" value="<? echo $form->value("user"); ?>"><? echo $form->error("user"); ?> <p><label>Wachtwoord</label></p> <input type="password" name="pass" maxlength="30" value="<? echo $form->value("pass"); ?>"><? echo $form->error("pass"); ?> <p><label>Onthoud mij </label><input type="checkbox" name="remember" <? if($form->value("remember") != ""){ echo "checked"; } ?>> <input type="hidden" name="sublogin" value="1"> <p><input type="submit" value="Login"></p> <!--<font size="2">[<a href="forgotpass.php">Wachtwoord vergeten?</a>]</font> <p>Nog niet geregistreerd? <a href="register.php">Aanmelden!</a></p>--> </form> </section> </article> </section> <aside id="sidebar"> <h3>Links</h3> <ul class="clearfix"> <li><a title="Home" href="../indexnl.html">Home</a></li> <li><a title="Leden" href="../ledennlp1.html">Leden</a></li> <li><a title="Album" href="../albumnl.html">Album</a></li> <li><a title="Kalender" href="../kalendernl.html">Kalender</a></li> <li><a title="Contact" href="../contactnl.html">Contact</a></li> </ul> <h3></h3> <ul class="clearfix"> <!--<li><a title="twitter" href="index.html">Twitter</a></li>--> <li><a title="Inschrijven" href="../inschrijvennl.html">Inschrijven</a></li> <li><a title="Gastenboek" href="gastenboek/guestbook.php">Gastenboek</a></li> <li><a title="Facebook" href="http://www.facebook.com/profile.php?id=100003840519242&ref=tn_tnmn#" class="new_window">Facebook</a></li> </ul> </aside> </section> <footer> <section id="footertop"> <aside class="footer-column"> <h4>Info</h4> Html5 en css3 beste resultaat in google chrome. </aside> <aside class="footer-column"> <h4>Mc bevers</h4> <address> <span>Postcode:</span>1547<br/> <span>Land:</span>Belgie<br/> <span>Plaats:</span>Bever<br/> <!--<span>Telefoon 1:</span>0<br/> <span>Telefoon 2:</span>0<br/> <span>Fax:</span>0<br/>--> <span>Email:</span><a href="mailto:info@mcbevers.be">info@mcbevers.be</a> </address> </aside> </section> <!--<section id="copyright"> <h4>Copyright</h4> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta.</p> </section>--> <section id="banners"> <ul class="banners"> <li><span><span><span><img src="../images/icon1.gif" alt="sponsor"><strong>Sponsor</strong>Sponsor worden?<a href="../contactnl.html" class="new_window"><br/>Klik hier</a></span></span></span></li> <li><span><span><span><img src="../images/icon2.gif" alt="sponsor"><strong>Sponsor</strong>Sponsor worden?<a href="../contactnl.html" class="new_window"><br/>Klik hier</a></span></span></span></li> <li class="last"><span><span><span><img src="../images/icon3.gif" alt="sponsor"><strong>Sponsor</strong>Sponsor worden?<a href="../contactnl.html" class="new_window"><br/>Klik hier</a></span></span></span></li> </ul> </section> <br> <section id="templatecopy"> <p>Edited by DeWezze</p> <p>Template design by <a title="derby web design" href="http://www.tristarwebdesign.co.uk">tristar web design</a></p> </section> <? } /** * Just a little page footer, tells how many registered members * there are, how many users currently logged in and viewing site, * and how many guests viewing site. Active users are displayed, * with link to their user information. */ echo "<center><b>Member Total:</b>".$database->getNumMembers()."<br/></center>"; echo "<center>There are $database->num_active_users registered members and "; echo "$database->num_active_guests guests viewing the site.</center>"; include("login/include/view_active.php"); ?> </footer> </div> </body> </html> thx Quote Link to comment Share on other sites More sharing options...
Skewled Posted June 3, 2012 Share Posted June 3, 2012 if($session->logged_in){ echo '<h1><img src="images/lock_unlocked.png" width="32" height="32">Logged In</h1>'; echo "<table width='600' cellpadding='5' cellspacing='5' border='1'>"; echo "<p>Welcome <b>$session->username</b></p> <br/><br/>" ."<tr><td>[<a href=\"userinfo.php?user=$session->username\">My Account</a>]</td></tr>" ."<tr><td>[<a href=\"useredit.php\">Edit Account</a>]</td></tr>"; if($session->isAdmin()){ echo "<tr><td>[<a href=\"admin/admin.php\">Admin Center</a>]</td></tr>"; echo "<tr><td>[<a href=\"../gastenboek/admin/index.php\">Gastenboek</a>]</td></tr>"; echo "<tr><td>[<a href=\"../livre d'or/admin/index.php\">livre d'or</a>]</td></tr>"; echo "<tr><td>[<a href=\"../upload/upload.form.php\">upload</a>]</td></tr>"; } echo "<tr><td>[<a href=\"process.php\">Logout</a>]</td></tr>"; } This is what is displayed when the user logs into the system, it's doing what it's suppose to. If you want the rest of the HTML to display then you have to also include here. That code is sloppy so I hope you didn't pay for it. Quote Link to comment Share on other sites More sharing options...
wezze Posted June 3, 2012 Author Share Posted June 3, 2012 So i need to enter the whole html thing in php? and how do i start doing that? Also with the echo strings? no i didnt pay for it. thx Quote Link to comment Share on other sites More sharing options...
Skewled Posted June 3, 2012 Share Posted June 3, 2012 Give me a few minutes and I'll adjust the code to suit what you need it to do.. My son is fussy at the moment! Quote Link to comment Share on other sites More sharing options...
Skewled Posted June 3, 2012 Share Posted June 3, 2012 <?php include("include/session.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>Mc Bevers home</title> <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen"/> <!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]--> <!--<link rel="stylesheet" type="text/css" href="css/styles.css" />--> <!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" src="script.js"></script>--> </head> <body> <div id="wrapper"> <nav> <ul class="lang"> <li><a href="../indexnl.html" class="nl">Nl</a></li> <li class="last"><a href="../indexfr.html" class="fr">Fr</a></li> </ul> <ul class="menu"> <li><a class="active" title="home" href="../indexnl.html">Home</a></li> <li><a title="Leden" href="../ledennlp1.html">Leden</a></li> <li><a title="Album" href="../albumnl.html">Album</a></li> <li><a title="Kalender" href="../kalendernl.html">Kalender</a></li> <li><a title="Contact" href="../contactnl.html">Contact</a></li> </ul> </nav> <header> <h1><a title="html5 template" href="../index.html">Mc Bevers</a></h1> </header> <section id="main" class="clearfix"> <section id="content"> <article> <?php /** * User has already logged in, so display relavent links, including * a link to the admin center if the user is an administrator. */ if($session->logged_in){ echo '<h1><img src="images/lock_unlocked.png" width="32" height="32">Logged In</h1>'; echo "<table width='600' cellpadding='5' cellspacing='5' border='1'>"; echo "<p>Welcome <b>$session->username</b></p> <br/><br/>" ."<tr><td>[<a href=\"userinfo.php?user=$session->username\">My Account</a>]</td></tr>" ."<tr><td>[<a href=\"useredit.php\">Edit Account</a>]</td></tr>"; if($session->isAdmin()){ echo "<tr><td>[<a href=\"admin/admin.php\">Admin Center</a>]</td></tr>"; echo "<tr><td>[<a href=\"../gastenboek/admin/index.php\">Gastenboek</a>]</td></tr>"; echo "<tr><td>[<a href=\"../livre d'or/admin/index.php\">livre d'or</a>]</td></tr>"; echo "<tr><td>[<a href=\"../upload/upload.form.php\">upload</a>]</td></tr>"; } echo "<tr><td>[<a href=\"process.php\">Logout</a>]</td></tr>"; } <aside id="sidebar"> <h3>Links</h3> <ul class="clearfix"> <li><a title="Home" href="../indexnl.html">Home</a></li> <li><a title="Leden" href="../ledennlp1.html">Leden</a></li> <li><a title="Album" href="../albumnl.html">Album</a></li> <li><a title="Kalender" href="../kalendernl.html">Kalender</a></li> <li><a title="Contact" href="../contactnl.html">Contact</a></li> </ul> <h3></h3> <ul class="clearfix"> <!--<li><a title="twitter" href="index.html">Twitter</a></li>--> <li><a title="Inschrijven" href="../inschrijvennl.html">Inschrijven</a></li> <li><a title="Gastenboek" href="gastenboek/guestbook.php">Gastenboek</a></li> <li><a title="Facebook" href="http://www.facebook.com/profile.php?id=100003840519242&ref=tn_tnmn#" class="new_window">Facebook</a></li> </ul> </aside> </section> <footer> <section id="footertop"> <aside class="footer-column"> <h4>Info</h4> Html5 en css3 beste resultaat in google chrome. </aside> <aside class="footer-column"> <h4>Mc bevers</h4> <address> <span>Postcode:</span>1547<br/> <span>Land:</span>Belgie<br/> <span>Plaats:</span>Bever<br/> <!--<span>Telefoon 1:</span>0<br/> <span>Telefoon 2:</span>0<br/> <span>Fax:</span>0<br/>--> <span>Email:</span><a href="mailto:info@mcbevers.be">info@mcbevers.be</a> </address> </aside> </section> <!--<section id="copyright"> <h4>Copyright</h4> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta.</p> </section>--> <section id="banners"> <ul class="banners"> <li><span><span><span><img src="../images/icon1.gif" alt="sponsor"><strong>Sponsor</strong>Sponsor worden?<a href="../contactnl.html" class="new_window"><br/>Klik hier</a></span></span></span></li> <li><span><span><span><img src="../images/icon2.gif" alt="sponsor"><strong>Sponsor</strong>Sponsor worden?<a href="../contactnl.html" class="new_window"><br/>Klik hier</a></span></span></span></li> <li class="last"><span><span><span><img src="../images/icon3.gif" alt="sponsor"><strong>Sponsor</strong>Sponsor worden?<a href="../contactnl.html" class="new_window"><br/>Klik hier</a></span></span></span></li> </ul> </section> <br> <section id="templatecopy"> <p>Edited by DeWezze</p> <p>Template design by <a title="derby web design" href="http://www.tristarwebdesign.co.uk">tristar web design</a></p> </section> <?php } /** * Just a little page footer, tells how many registered members * there are, how many users currently logged in and viewing site, * and how many guests viewing site. Active users are displayed, * with link to their user information. */ echo "<center><b>Member Total:</b>".$database->getNumMembers()."<br/></center>"; echo "<center>There are $database->num_active_users registered members and "; echo "$database->num_active_guests guests viewing the site.</center>"; include("login/include/view_active.php"); else{ ?> <?php /** * User not logged in, display the login form. * If user has already tried to login, but errors were * found, display the total number of errors. * If errors occurred, they will be displayed. */ if($form->num_errors > 0){ echo "<p><font size=\"2\">".$form->num_errors." error(s) found</font></p>"; } ?> <section id="form1"> <h3>Login</h3> <form action="process.php" method="post"> <p><label>Gebruikers naam</label></p> <input type="text" name="user" maxlength="30" value="<? echo $form->value("user"); ?>"><? echo $form->error("user"); ?> <p><label>Wachtwoord</label></p> <input type="password" name="pass" maxlength="30" value="<? echo $form->value("pass"); ?>"><? echo $form->error("pass"); ?> <p><label>Onthoud mij </label><input type="checkbox" name="remember" <? if($form->value("remember") != ""){ echo "checked"; } ?>> <input type="hidden" name="sublogin" value="1"> <p><input type="submit" value="Login"></p> <!--<font size="2">[<a href="forgotpass.php">Wachtwoord vergeten?</a>]</font> <p>Nog niet geregistreerd? <a href="register.php">Aanmelden!</a></p>--> </form> </section> </article> </section> <aside id="sidebar"> <h3>Links</h3> <ul class="clearfix"> <li><a title="Home" href="../indexnl.html">Home</a></li> <li><a title="Leden" href="../ledennlp1.html">Leden</a></li> <li><a title="Album" href="../albumnl.html">Album</a></li> <li><a title="Kalender" href="../kalendernl.html">Kalender</a></li> <li><a title="Contact" href="../contactnl.html">Contact</a></li> </ul> <h3></h3> <ul class="clearfix"> <!--<li><a title="twitter" href="index.html">Twitter</a></li>--> <li><a title="Inschrijven" href="../inschrijvennl.html">Inschrijven</a></li> <li><a title="Gastenboek" href="gastenboek/guestbook.php">Gastenboek</a></li> <li><a title="Facebook" href="http://www.facebook.com/profile.php?id=100003840519242&ref=tn_tnmn#" class="new_window">Facebook</a></li> </ul> </aside> </section> <footer> <section id="footertop"> <aside class="footer-column"> <h4>Info</h4> Html5 en css3 beste resultaat in google chrome. </aside> <aside class="footer-column"> <h4>Mc bevers</h4> <address> <span>Postcode:</span>1547<br/> <span>Land:</span>Belgie<br/> <span>Plaats:</span>Bever<br/> <!--<span>Telefoon 1:</span>0<br/> <span>Telefoon 2:</span>0<br/> <span>Fax:</span>0<br/>--> <span>Email:</span><a href="mailto:info@mcbevers.be">info@mcbevers.be</a> </address> </aside> </section> <!--<section id="copyright"> <h4>Copyright</h4> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta.</p> </section>--> <section id="banners"> <ul class="banners"> <li><span><span><span><img src="../images/icon1.gif" alt="sponsor"><strong>Sponsor</strong>Sponsor worden?<a href="../contactnl.html" class="new_window"><br/>Klik hier</a></span></span></span></li> <li><span><span><span><img src="../images/icon2.gif" alt="sponsor"><strong>Sponsor</strong>Sponsor worden?<a href="../contactnl.html" class="new_window"><br/>Klik hier</a></span></span></span></li> <li class="last"><span><span><span><img src="../images/icon3.gif" alt="sponsor"><strong>Sponsor</strong>Sponsor worden?<a href="../contactnl.html" class="new_window"><br/>Klik hier</a></span></span></span></li> </ul> </section> <br> <section id="templatecopy"> <p>Edited by DeWezze</p> <p>Template design by <a title="derby web design" href="http://www.tristarwebdesign.co.uk">tristar web design</a></p> </section> <?php } /** * Just a little page footer, tells how many registered members * there are, how many users currently logged in and viewing site, * and how many guests viewing site. Active users are displayed, * with link to their user information. */ echo "<center><b>Member Total:</b>".$database->getNumMembers()."<br/></center>"; echo "<center>There are $database->num_active_users registered members and "; echo "$database->num_active_guests guests viewing the site.</center>"; include("login/include/view_active.php"); ?> </footer> </div> </body> </html> That's a hackish way to do this, but should do what you want. Quote Link to comment Share on other sites More sharing options...
wezze Posted June 3, 2012 Author Share Posted June 3, 2012 ok i copy pasted your code and uploaded it but now i get an error when i try to load the page. thx Quote Link to comment Share on other sites More sharing options...
Skewled Posted June 3, 2012 Share Posted June 3, 2012 <? include("include/session.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>Mc Bevers home</title> <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen"/> <!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]--> <!--<link rel="stylesheet" type="text/css" href="css/styles.css" />--> <!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" src="script.js"></script>--> </head> <body> <div id="wrapper"> <nav> <ul class="lang"> <li><a href="../indexnl.html" class="nl">Nl</a></li> <li class="last"><a href="../indexfr.html" class="fr">Fr</a></li> </ul> <ul class="menu"> <li><a class="active" title="home" href="../indexnl.html">Home</a></li> <li><a title="Leden" href="../ledennlp1.html">Leden</a></li> <li><a title="Album" href="../albumnl.html">Album</a></li> <li><a title="Kalender" href="../kalendernl.html">Kalender</a></li> <li><a title="Contact" href="../contactnl.html">Contact</a></li> </ul> </nav> <header> <h1><a title="html5 template" href="../index.html">Mc Bevers</a></h1> </header> <section id="main" class="clearfix"> <section id="content"> <article> <? /** * User has already logged in, so display relavent links, including * a link to the admin center if the user is an administrator. */ if($session->logged_in){ echo '<h1><img src="images/lock_unlocked.png" width="32" height="32">Logged In</h1>'; echo "<table width='600' cellpadding='5' cellspacing='5' border='1'>"; echo "<p>Welcome <b>$session->username</b></p> <br/><br/>" ."<tr><td>[<a href=\"userinfo.php?user=$session->username\">My Account</a>]</td></tr>" ."<tr><td>[<a href=\"useredit.php\">Edit Account</a>]</td></tr>"; if($session->isAdmin()){ echo "<tr><td>[<a href=\"admin/admin.php\">Admin Center</a>]</td></tr>"; echo "<tr><td>[<a href=\"../gastenboek/admin/index.php\">Gastenboek</a>]</td></tr>"; echo "<tr><td>[<a href=\"../livre d'or/admin/index.php\">livre d'or</a>]</td></tr>"; echo "<tr><td>[<a href=\"../upload/upload.form.php\">upload</a>]</td></tr>"; } echo "<tr><td>[<a href=\"process.php\">Logout</a>]</td></tr>"; } <aside id="sidebar"> <h3>Links</h3> <ul class="clearfix"> <li><a title="Home" href="../indexnl.html">Home</a></li> <li><a title="Leden" href="../ledennlp1.html">Leden</a></li> <li><a title="Album" href="../albumnl.html">Album</a></li> <li><a title="Kalender" href="../kalendernl.html">Kalender</a></li> <li><a title="Contact" href="../contactnl.html">Contact</a></li> </ul> <h3></h3> <ul class="clearfix"> <!--<li><a title="twitter" href="index.html">Twitter</a></li>--> <li><a title="Inschrijven" href="../inschrijvennl.html">Inschrijven</a></li> <li><a title="Gastenboek" href="gastenboek/guestbook.php">Gastenboek</a></li> <li><a title="Facebook" href="http://www.facebook.com/profile.php?id=100003840519242&ref=tn_tnmn#" class="new_window">Facebook</a></li> </ul> </aside> </section> <footer> <section id="footertop"> <aside class="footer-column"> <h4>Info</h4> Html5 en css3 beste resultaat in google chrome. </aside> <aside class="footer-column"> <h4>Mc bevers</h4> <address> <span>Postcode:</span>1547<br/> <span>Land:</span>Belgie<br/> <span>Plaats:</span>Bever<br/> <!--<span>Telefoon 1:</span>0<br/> <span>Telefoon 2:</span>0<br/> <span>Fax:</span>0<br/>--> <span>Email:</span><a href="mailto:info@mcbevers.be">info@mcbevers.be</a> </address> </aside> </section> <!--<section id="copyright"> <h4>Copyright</h4> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta.</p> </section>--> <section id="banners"> <ul class="banners"> <li><span><span><span><img src="../images/icon1.gif" alt="sponsor"><strong>Sponsor</strong>Sponsor worden?<a href="../contactnl.html" class="new_window"><br/>Klik hier</a></span></span></span></li> <li><span><span><span><img src="../images/icon2.gif" alt="sponsor"><strong>Sponsor</strong>Sponsor worden?<a href="../contactnl.html" class="new_window"><br/>Klik hier</a></span></span></span></li> <li class="last"><span><span><span><img src="../images/icon3.gif" alt="sponsor"><strong>Sponsor</strong>Sponsor worden?<a href="../contactnl.html" class="new_window"><br/>Klik hier</a></span></span></span></li> </ul> </section> <br> <section id="templatecopy"> <p>Edited by DeWezze</p> <p>Template design by <a title="derby web design" href="http://www.tristarwebdesign.co.uk">tristar web design</a></p> </section> <? } /** * Just a little page footer, tells how many registered members * there are, how many users currently logged in and viewing site, * and how many guests viewing site. Active users are displayed, * with link to their user information. */ echo "<center><b>Member Total:</b>".$database->getNumMembers()."<br/></center>"; echo "<center>There are $database->num_active_users registered members and "; echo "$database->num_active_guests guests viewing the site.</center>"; include("login/include/view_active.php"); ?> </footer> </div> </body> </html> else{ ?> <? /** * User not logged in, display the login form. * If user has already tried to login, but errors were * found, display the total number of errors. * If errors occurred, they will be displayed. */ if($form->num_errors > 0){ echo "<p><font size=\"2\">".$form->num_errors." error(s) found</font></p>"; } ?> <section id="form1"> <h3>Login</h3> <form action="process.php" method="post"> <p><label>Gebruikers naam</label></p> <input type="text" name="user" maxlength="30" value="<? echo $form->value("user"); ?>"><? echo $form->error("user"); ?> <p><label>Wachtwoord</label></p> <input type="password" name="pass" maxlength="30" value="<? echo $form->value("pass"); ?>"><? echo $form->error("pass"); ?> <p><label>Onthoud mij </label><input type="checkbox" name="remember" <? if($form->value("remember") != ""){ echo "checked"; } ?>> <input type="hidden" name="sublogin" value="1"> <p><input type="submit" value="Login"></p> <!--<font size="2">[<a href="forgotpass.php">Wachtwoord vergeten?</a>]</font> <p>Nog niet geregistreerd? <a href="register.php">Aanmelden!</a></p>--> </form> </section> </article> </section> <aside id="sidebar"> <h3>Links</h3> <ul class="clearfix"> <li><a title="Home" href="../indexnl.html">Home</a></li> <li><a title="Leden" href="../ledennlp1.html">Leden</a></li> <li><a title="Album" href="../albumnl.html">Album</a></li> <li><a title="Kalender" href="../kalendernl.html">Kalender</a></li> <li><a title="Contact" href="../contactnl.html">Contact</a></li> </ul> <h3></h3> <ul class="clearfix"> <!--<li><a title="twitter" href="index.html">Twitter</a></li>--> <li><a title="Inschrijven" href="../inschrijvennl.html">Inschrijven</a></li> <li><a title="Gastenboek" href="gastenboek/guestbook.php">Gastenboek</a></li> <li><a title="Facebook" href="http://www.facebook.com/profile.php?id=100003840519242&ref=tn_tnmn#" class="new_window">Facebook</a></li> </ul> </aside> </section> <footer> <section id="footertop"> <aside class="footer-column"> <h4>Info</h4> Html5 en css3 beste resultaat in google chrome. </aside> <aside class="footer-column"> <h4>Mc bevers</h4> <address> <span>Postcode:</span>1547<br/> <span>Land:</span>Belgie<br/> <span>Plaats:</span>Bever<br/> <!--<span>Telefoon 1:</span>0<br/> <span>Telefoon 2:</span>0<br/> <span>Fax:</span>0<br/>--> <span>Email:</span><a href="mailto:info@mcbevers.be">info@mcbevers.be</a> </address> </aside> </section> <!--<section id="copyright"> <h4>Copyright</h4> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta.</p> </section>--> <section id="banners"> <ul class="banners"> <li><span><span><span><img src="../images/icon1.gif" alt="sponsor"><strong>Sponsor</strong>Sponsor worden?<a href="../contactnl.html" class="new_window"><br/>Klik hier</a></span></span></span></li> <li><span><span><span><img src="../images/icon2.gif" alt="sponsor"><strong>Sponsor</strong>Sponsor worden?<a href="../contactnl.html" class="new_window"><br/>Klik hier</a></span></span></span></li> <li class="last"><span><span><span><img src="../images/icon3.gif" alt="sponsor"><strong>Sponsor</strong>Sponsor worden?<a href="../contactnl.html" class="new_window"><br/>Klik hier</a></span></span></span></li> </ul> </section> <br> <section id="templatecopy"> <p>Edited by DeWezze</p> <p>Template design by <a title="derby web design" href="http://www.tristarwebdesign.co.uk">tristar web design</a></p> </section> <? } /** * Just a little page footer, tells how many registered members * there are, how many users currently logged in and viewing site, * and how many guests viewing site. Active users are displayed, * with link to their user information. */ echo "<center><b>Member Total:</b>".$database->getNumMembers()."<br/></center>"; echo "<center>There are $database->num_active_users registered members and "; echo "$database->num_active_guests guests viewing the site.</center>"; include("login/include/view_active.php"); ?> </footer> </div> </body> </html> I added <?php to the tags for starting the php script, removed them. Give the above a try. Quote Link to comment Share on other sites More sharing options...
wezze Posted June 3, 2012 Author Share Posted June 3, 2012 still get an error thx Quote Link to comment Share on other sites More sharing options...
Skewled Posted June 3, 2012 Share Posted June 3, 2012 Ok restore the default one your using and I'll go over the code on my end while my son is taking a nap. Quote Link to comment Share on other sites More sharing options...
wezze Posted June 3, 2012 Author Share Posted June 3, 2012 ok ty can you tell me what you did or changed after? cause with copy paste i wont learn much . thx Quote Link to comment Share on other sites More sharing options...
Skewled Posted June 3, 2012 Share Posted June 3, 2012 What my thinking was is that you have a condition: If the session exists then load the following options... {} Check for admin login and load additional options... {} ELSE we load a form for the user to login with... { INSIDE HERE - all of the layout is completed } So I copied the CSS elements and output from the section where the user isn't logged in and transplanted them also in the top portion where the user is logged in. I added <?php to the tag <? so it would color the php in the code tags and make it easier to read the code. So the below code is just putting a few of the elements in the logged in section, the goal was to render the remaining portion of the page.. your side bar, footer, etc.. <? include("include/session.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>Mc Bevers home</title> <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen"/> <!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]--> <!--<link rel="stylesheet" type="text/css" href="css/styles.css" />--> <!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" src="script.js"></script>--> </head> <body> <div id="wrapper"> <nav> <ul class="lang"> <li><a href="../indexnl.html" class="nl">Nl</a></li> <li class="last"><a href="../indexfr.html" class="fr">Fr</a></li> </ul> <ul class="menu"> <li><a class="active" title="home" href="../indexnl.html">Home</a></li> <li><a title="Leden" href="../ledennlp1.html">Leden</a></li> <li><a title="Album" href="../albumnl.html">Album</a></li> <li><a title="Kalender" href="../kalendernl.html">Kalender</a></li> <li><a title="Contact" href="../contactnl.html">Contact</a></li> </ul> </nav> <header> <h1><a title="html5 template" href="../index.html">Mc Bevers</a></h1> </header> <section id="main" class="clearfix"> <section id="content"> <article> <? /** * User has already logged in, so display relavent links, including * a link to the admin center if the user is an administrator. */ if($session->logged_in){ echo '<h1><img src="images/lock_unlocked.png" width="32" height="32">Logged In</h1>'; echo "<table width='600' cellpadding='5' cellspacing='5' border='1'>"; echo "<p>Welcome <b>$session->username</b></p> <br/><br/>" ."<tr><td>[<a href=\"userinfo.php?user=$session->username\">My Account</a>]</td></tr>" ."<tr><td>[<a href=\"useredit.php\">Edit Account</a>]</td></tr>"; if($session->isAdmin()){ echo "<tr><td>[<a href=\"admin/admin.php\">Admin Center</a>]</td></tr>"; echo "<tr><td>[<a href=\"../gastenboek/admin/index.php\">Gastenboek</a>]</td></tr>"; echo "<tr><td>[<a href=\"../livre d'or/admin/index.php\">livre d'or</a>]</td></tr>"; echo "<tr><td>[<a href=\"../upload/upload.form.php\">upload</a>]</td></tr>"; } echo "<tr><td>[<a href=\"process.php\">Logout</a>]</td></tr>"; } </article> </section> /** * Just a little page footer, tells how many registered members * there are, how many users currently logged in and viewing site, * and how many guests viewing site. Active users are displayed, * with link to their user information. */ echo "<center><b>Member Total:</b>".$database->getNumMembers()."<br/></center>"; echo "<center>There are $database->num_active_users registered members and "; echo "$database->num_active_guests guests viewing the site.</center>"; include("login/include/view_active.php"); else{ ?> <? /** * User not logged in, display the login form. * If user has already tried to login, but errors were * found, display the total number of errors. * If errors occurred, they will be displayed. */ if($form->num_errors > 0){ echo "<p><font size=\"2\">".$form->num_errors." error(s) found</font></p>"; } ?> <section id="form1"> <h3>Login</h3> <form action="process.php" method="post"> <p><label>Gebruikers naam</label></p> <input type="text" name="user" maxlength="30" value="<? echo $form->value("user"); ?>"><? echo $form->error("user"); ?> <p><label>Wachtwoord</label></p> <input type="password" name="pass" maxlength="30" value="<? echo $form->value("pass"); ?>"><? echo $form->error("pass"); ?> <p><label>Onthoud mij </label><input type="checkbox" name="remember" <? if($form->value("remember") != ""){ echo "checked"; } ?>> <input type="hidden" name="sublogin" value="1"> <p><input type="submit" value="Login"></p> <!--<font size="2">[<a href="forgotpass.php">Wachtwoord vergeten?</a>]</font> <p>Nog niet geregistreerd? <a href="register.php">Aanmelden!</a></p>--> </form> </section> </article> </section> <aside id="sidebar"> <h3>Links</h3> <ul class="clearfix"> <li><a title="Home" href="../indexnl.html">Home</a></li> <li><a title="Leden" href="../ledennlp1.html">Leden</a></li> <li><a title="Album" href="../albumnl.html">Album</a></li> <li><a title="Kalender" href="../kalendernl.html">Kalender</a></li> <li><a title="Contact" href="../contactnl.html">Contact</a></li> </ul> <h3></h3> <ul class="clearfix"> <!--<li><a title="twitter" href="index.html">Twitter</a></li>--> <li><a title="Inschrijven" href="../inschrijvennl.html">Inschrijven</a></li> <li><a title="Gastenboek" href="gastenboek/guestbook.php">Gastenboek</a></li> <li><a title="Facebook" href="http://www.facebook.com/profile.php?id=100003840519242&ref=tn_tnmn#" class="new_window">Facebook</a></li> </ul> </aside> </section> <footer> <section id="footertop"> <aside class="footer-column"> <h4>Info</h4> Html5 en css3 beste resultaat in google chrome. </aside> <aside class="footer-column"> <h4>Mc bevers</h4> <address> <span>Postcode:</span>1547<br/> <span>Land:</span>Belgie<br/> <span>Plaats:</span>Bever<br/> <!--<span>Telefoon 1:</span>0<br/> <span>Telefoon 2:</span>0<br/> <span>Fax:</span>0<br/>--> <span>Email:</span><a href="mailto:info@mcbevers.be">info@mcbevers.be</a> </address> </aside> </section> <!--<section id="copyright"> <h4>Copyright</h4> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta.</p> </section>--> <section id="banners"> <ul class="banners"> <li><span><span><span><img src="../images/icon1.gif" alt="sponsor"><strong>Sponsor</strong>Sponsor worden?<a href="../contactnl.html" class="new_window"><br/>Klik hier</a></span></span></span></li> <li><span><span><span><img src="../images/icon2.gif" alt="sponsor"><strong>Sponsor</strong>Sponsor worden?<a href="../contactnl.html" class="new_window"><br/>Klik hier</a></span></span></span></li> <li class="last"><span><span><span><img src="../images/icon3.gif" alt="sponsor"><strong>Sponsor</strong>Sponsor worden?<a href="../contactnl.html" class="new_window"><br/>Klik hier</a></span></span></span></li> </ul> </section> <br> <section id="templatecopy"> <p>Edited by DeWezze</p> <p>Template design by <a title="derby web design" href="http://www.tristarwebdesign.co.uk">tristar web design</a></p> </section> <? } /** * Just a little page footer, tells how many registered members * there are, how many users currently logged in and viewing site, * and how many guests viewing site. Active users are displayed, * with link to their user information. */ echo "<center><b>Member Total:</b>".$database->getNumMembers()."<br/></center>"; echo "<center>There are $database->num_active_users registered members and "; echo "$database->num_active_guests guests viewing the site.</center>"; include("login/include/view_active.php"); ?> </footer> </div> </body> </html> Quote Link to comment Share on other sites More sharing options...
Skewled Posted June 3, 2012 Share Posted June 3, 2012 <? include("include/session.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>Mc Bevers home</title> <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen"/> <!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]--> <!--<link rel="stylesheet" type="text/css" href="css/styles.css" />--> <!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" src="script.js"></script>--> </head> <body> <div id="wrapper"> <nav> <ul class="lang"> <li><a href="../indexnl.html" class="nl">Nl</a></li> <li class="last"><a href="../indexfr.html" class="fr">Fr</a></li> </ul> <ul class="menu"> <li><a class="active" title="home" href="../indexnl.html">Home</a></li> <li><a title="Leden" href="../ledennlp1.html">Leden</a></li> <li><a title="Album" href="../albumnl.html">Album</a></li> <li><a title="Kalender" href="../kalendernl.html">Kalender</a></li> <li><a title="Contact" href="../contactnl.html">Contact</a></li> </ul> </nav> <header> <h1><a title="html5 template" href="../index.html">Mc Bevers</a></h1> </header> <section id="main" class="clearfix"> <section id="content"> <article> <? /** * User has already logged in, so display relavent links, including * a link to the admin center if the user is an administrator. */ if($session->logged_in){ echo '<h1><img src="images/lock_unlocked.png" width="32" height="32">Logged In</h1>'; echo "<table width='600' cellpadding='5' cellspacing='5' border='1'>"; echo "<p>Welcome <b>$session->username</b></p> <br/><br/>" ."<tr><td>[<a href=\"userinfo.php?user=$session->username\">My Account</a>]</td></tr>" ."<tr><td>[<a href=\"useredit.php\">Edit Account</a>]</td></tr>"; if($session->isAdmin()){ echo "<tr><td>[<a href=\"admin/admin.php\">Admin Center</a>]</td></tr>"; echo "<tr><td>[<a href=\"../gastenboek/admin/index.php\">Gastenboek</a>]</td></tr>"; echo "<tr><td>[<a href=\"../livre d'or/admin/index.php\">livre d'or</a>]</td></tr>"; echo "<tr><td>[<a href=\"../upload/upload.form.php\">upload</a>]</td></tr>"; } echo "<tr><td>[<a href=\"process.php\">Logout</a>]</td></tr>"; } else{ ?> <? /** * User not logged in, display the login form. * If user has already tried to login, but errors were * found, display the total number of errors. * If errors occurred, they will be displayed. */ if($form->num_errors > 0){ echo "<p><font size=\"2\">".$form->num_errors." error(s) found</font></p>"; } ?> <section id="form1"> <h3>Login</h3> <form action="process.php" method="post"> <p><label>Gebruikers naam</label></p> <input type="text" name="user" maxlength="30" value="<? echo $form->value("user"); ?>"><? echo $form->error("user"); ?> <p><label>Wachtwoord</label></p> <input type="password" name="pass" maxlength="30" value="<? echo $form->value("pass"); ?>"><? echo $form->error("pass"); ?> <p><label>Onthoud mij </label><input type="checkbox" name="remember" <? if($form->value("remember") != ""){ echo "checked"; } ?>> <input type="hidden" name="sublogin" value="1"> <p><input type="submit" value="Login"></p> <!--<font size="2">[<a href="forgotpass.php">Wachtwoord vergeten?</a>]</font> <p>Nog niet geregistreerd? <a href="register.php">Aanmelden!</a></p>--> </form> </section> </article> </section> <? } ?> <aside id="sidebar"> <h3>Links</h3> <ul class="clearfix"> <li><a title="Home" href="../indexnl.html">Home</a></li> <li><a title="Leden" href="../ledennlp1.html">Leden</a></li> <li><a title="Album" href="../albumnl.html">Album</a></li> <li><a title="Kalender" href="../kalendernl.html">Kalender</a></li> <li><a title="Contact" href="../contactnl.html">Contact</a></li> </ul> <h3></h3> <ul class="clearfix"> <!--<li><a title="twitter" href="index.html">Twitter</a></li>--> <li><a title="Inschrijven" href="../inschrijvennl.html">Inschrijven</a></li> <li><a title="Gastenboek" href="gastenboek/guestbook.php">Gastenboek</a></li> <li><a title="Facebook" href="http://www.facebook.com/profile.php?id=100003840519242&ref=tn_tnmn#" class="new_window">Facebook</a></li> </ul> </aside> </section> <footer> <section id="footertop"> <aside class="footer-column"> <h4>Info</h4> Html5 en css3 beste resultaat in google chrome. </aside> <aside class="footer-column"> <h4>Mc bevers</h4> <address> <span>Postcode:</span>1547<br/> <span>Land:</span>Belgie<br/> <span>Plaats:</span>Bever<br/> <!--<span>Telefoon 1:</span>0<br/> <span>Telefoon 2:</span>0<br/> <span>Fax:</span>0<br/>--> <span>Email:</span><a href="mailto:info@mcbevers.be">info@mcbevers.be</a> </address> </aside> </section> <!--<section id="copyright"> <h4>Copyright</h4> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta.</p> </section>--> <section id="banners"> <ul class="banners"> <li><span><span><span><img src="../images/icon1.gif" alt="sponsor"><strong>Sponsor</strong>Sponsor worden?<a href="../contactnl.html" class="new_window"><br/>Klik hier</a></span></span></span></li> <li><span><span><span><img src="../images/icon2.gif" alt="sponsor"><strong>Sponsor</strong>Sponsor worden?<a href="../contactnl.html" class="new_window"><br/>Klik hier</a></span></span></span></li> <li class="last"><span><span><span><img src="../images/icon3.gif" alt="sponsor"><strong>Sponsor</strong>Sponsor worden?<a href="../contactnl.html" class="new_window"><br/>Klik hier</a></span></span></span></li> </ul> </section> <br> <section id="templatecopy"> <p>Edited by DeWezze</p> <p>Template design by <a title="derby web design" href="http://www.tristarwebdesign.co.uk">tristar web design</a></p> </section> <? /** * Just a little page footer, tells how many registered members * there are, how many users currently logged in and viewing site, * and how many guests viewing site. Active users are displayed, * with link to their user information. */ echo "<center><b>Member Total:</b>".$database->getNumMembers()."<br/></center>"; echo "<center>There are $database->num_active_users registered members and "; echo "$database->num_active_guests guests viewing the site.</center>"; include("login/include/view_active.php"); ?> </footer> </div> </body> </html> Give this a go :D Quote Link to comment Share on other sites More sharing options...
wezze Posted June 3, 2012 Author Share Posted June 3, 2012 almost http://mcbevers.be/login/index.php user test1 pass test it shows everyting now but not how it should appear i see you only added <? } ?> 1opens php 1 closes and what does the middle 1 do? thanks Quote Link to comment Share on other sites More sharing options...
Skewled Posted June 3, 2012 Share Posted June 3, 2012 I didn't add any php tags, I noticed the } ending bracket for the if / else loop was not in the right place. The issue now is that the <article> tag is not ending where it needs to and causing the page to shift down, and those links to be displayed at the bottom of the page. So I added a </article> closing tag after those links to cut it off. Give this new one a go and hopefully it will resolve your issue... This is some very sloppy code and I'm glad you didn't buy it! HTML, CSS, and PHP should all be separated and written cleanly. That's what I mean when I say sloppy code, as you can see this isn't how this code is written. <? include("include/session.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>Mc Bevers home</title> <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen"/> <!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]--> <!--<link rel="stylesheet" type="text/css" href="css/styles.css" />--> <!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" src="script.js"></script>--> </head> <body> <div id="wrapper"> <nav> <ul class="lang"> <li><a href="../indexnl.html" class="nl">Nl</a></li> <li class="last"><a href="../indexfr.html" class="fr">Fr</a></li> </ul> <ul class="menu"> <li><a class="active" title="home" href="../indexnl.html">Home</a></li> <li><a title="Leden" href="../ledennlp1.html">Leden</a></li> <li><a title="Album" href="../albumnl.html">Album</a></li> <li><a title="Kalender" href="../kalendernl.html">Kalender</a></li> <li><a title="Contact" href="../contactnl.html">Contact</a></li> </ul> </nav> <header> <h1><a title="html5 template" href="../index.html">Mc Bevers</a></h1> </header> <section id="main" class="clearfix"> <section id="content"> <article> <? /** * User has already logged in, so display relavent links, including * a link to the admin center if the user is an administrator. */ if($session->logged_in){ echo '<h1><img src="images/lock_unlocked.png" width="32" height="32">Logged In</h1>'; echo "<table width='600' cellpadding='5' cellspacing='5' border='1'>"; echo "<p>Welcome <b>$session->username</b></p> <br/><br/>" ."<tr><td>[<a href=\"userinfo.php?user=$session->username\">My Account</a>]</td></tr>" ."<tr><td>[<a href=\"useredit.php\">Edit Account</a>]</td></tr>"; if($session->isAdmin()){ echo "<tr><td>[<a href=\"admin/admin.php\">Admin Center</a>]</td></tr>"; echo "<tr><td>[<a href=\"../gastenboek/admin/index.php\">Gastenboek</a>]</td></tr>"; echo "<tr><td>[<a href=\"../livre d'or/admin/index.php\">livre d'or</a>]</td></tr>"; echo "<tr><td>[<a href=\"../upload/upload.form.php\">upload</a>]</td></tr>"; } echo "<tr><td>[<a href=\"process.php\">Logout</a>]</td></tr>"; } </article> else{ ?> <? /** * User not logged in, display the login form. * If user has already tried to login, but errors were * found, display the total number of errors. * If errors occurred, they will be displayed. */ if($form->num_errors > 0){ echo "<p><font size=\"2\">".$form->num_errors." error(s) found</font></p>"; } ?> <section id="form1"> <h3>Login</h3> <form action="process.php" method="post"> <p><label>Gebruikers naam</label></p> <input type="text" name="user" maxlength="30" value="<? echo $form->value("user"); ?>"><? echo $form->error("user"); ?> <p><label>Wachtwoord</label></p> <input type="password" name="pass" maxlength="30" value="<? echo $form->value("pass"); ?>"><? echo $form->error("pass"); ?> <p><label>Onthoud mij </label><input type="checkbox" name="remember" <? if($form->value("remember") != ""){ echo "checked"; } ?>> <input type="hidden" name="sublogin" value="1"> <p><input type="submit" value="Login"></p> <!--<font size="2">[<a href="forgotpass.php">Wachtwoord vergeten?</a>]</font> <p>Nog niet geregistreerd? <a href="register.php">Aanmelden!</a></p>--> </form> </section> </article> </section> <? } ?> <aside id="sidebar"> <h3>Links</h3> <ul class="clearfix"> <li><a title="Home" href="../indexnl.html">Home</a></li> <li><a title="Leden" href="../ledennlp1.html">Leden</a></li> <li><a title="Album" href="../albumnl.html">Album</a></li> <li><a title="Kalender" href="../kalendernl.html">Kalender</a></li> <li><a title="Contact" href="../contactnl.html">Contact</a></li> </ul> <h3></h3> <ul class="clearfix"> <!--<li><a title="twitter" href="index.html">Twitter</a></li>--> <li><a title="Inschrijven" href="../inschrijvennl.html">Inschrijven</a></li> <li><a title="Gastenboek" href="gastenboek/guestbook.php">Gastenboek</a></li> <li><a title="Facebook" href="http://www.facebook.com/profile.php?id=100003840519242&ref=tn_tnmn#" class="new_window">Facebook</a></li> </ul> </aside> </section> <footer> <section id="footertop"> <aside class="footer-column"> <h4>Info</h4> Html5 en css3 beste resultaat in google chrome. </aside> <aside class="footer-column"> <h4>Mc bevers</h4> <address> <span>Postcode:</span>1547<br/> <span>Land:</span>Belgie<br/> <span>Plaats:</span>Bever<br/> <!--<span>Telefoon 1:</span>0<br/> <span>Telefoon 2:</span>0<br/> <span>Fax:</span>0<br/>--> <span>Email:</span><a href="mailto:info@mcbevers.be">info@mcbevers.be</a> </address> </aside> </section> <!--<section id="copyright"> <h4>Copyright</h4> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta.</p> </section>--> <section id="banners"> <ul class="banners"> <li><span><span><span><img src="../images/icon1.gif" alt="sponsor"><strong>Sponsor</strong>Sponsor worden?<a href="../contactnl.html" class="new_window"><br/>Klik hier</a></span></span></span></li> <li><span><span><span><img src="../images/icon2.gif" alt="sponsor"><strong>Sponsor</strong>Sponsor worden?<a href="../contactnl.html" class="new_window"><br/>Klik hier</a></span></span></span></li> <li class="last"><span><span><span><img src="../images/icon3.gif" alt="sponsor"><strong>Sponsor</strong>Sponsor worden?<a href="../contactnl.html" class="new_window"><br/>Klik hier</a></span></span></span></li> </ul> </section> <br> <section id="templatecopy"> <p>Edited by DeWezze</p> <p>Template design by <a title="derby web design" href="http://www.tristarwebdesign.co.uk">tristar web design</a></p> </section> <? /** * Just a little page footer, tells how many registered members * there are, how many users currently logged in and viewing site, * and how many guests viewing site. Active users are displayed, * with link to their user information. */ echo "<center><b>Member Total:</b>".$database->getNumMembers()."<br/></center>"; echo "<center>There are $database->num_active_users registered members and "; echo "$database->num_active_guests guests viewing the site.</center>"; include("login/include/view_active.php"); ?> </footer> </div> </body> </html> Quote Link to comment Share on other sites More sharing options...
wezze Posted June 3, 2012 Author Share Posted June 3, 2012 error again :s the sloppy part of the code could be mine i added some code to the php script so it would fit in my site. this was the original file <? /** * Main.php * * This is an example of the main page of a website. Here * users will be able to login. However, like on most sites * the login form doesn't just have to be on the main page, * but re-appear on subsequent pages, depending on whether * the user has logged in or not. * * Please subscribe to our feeds at http://blog.geotitles.com for more such tutorials */ include("include/session.php"); ?> <html> <title>login page | jQuery, AJAX, PHP, MySQL, javascript, web design tutorials & demos | php login script demo</title> <body> <table> <tr> <td> <? /** * User has already logged in, so display relavent links, including * a link to the admin center if the user is an administrator. */ if($session->logged_in){ echo '<h3>This is the live demo of <a href="http://blog.geotitles.com/2011/08/php-login-script-with-advanced-features">PHP login script with added features</a> at <a href="http://blog.geotitles.com">GEO WEB STATION</a>, Click here for the tutorial <a href="http://blog.geotitles.com/2011/08/php-login-script-with-advanced-features">link</a></h3>'; echo '<h1><img src="images/lock_unlocked.png" width="32" height="32">Logged In</h1>'; echo "Welcome <b>$session->username</b>, you are logged in. <br><br>" ."[<a href=\"userinfo.php?user=$session->username\">My Account</a>] " ."[<a href=\"useredit.php\">Edit Account</a>] "; if($session->isAdmin()){ echo "[<a href=\"admin/admin.php\">Admin Center</a>] "; } echo "[<a href=\"process.php\">Logout</a>]"; } else{ ?> <h3>This is the live demo of <a href="http://blog.geotitles.com/2011/08/php-login-script-with-advanced-features">PHP login script with added features</a> at <a href="http://blog.geotitles.com">GEO WEB STATION</a>, Click here for the tutorial <a href="http://blog.geotitles.com/2011/08/php-login-script-with-advanced-features">link</a></h3> <h1><img src="images/lock_locked.png" width="32" height="32" alt="Login">Admin Login</h1> <? /** * User not logged in, display the login form. * If user has already tried to login, but errors were * found, display the total number of errors. * If errors occurred, they will be displayed. */ if($form->num_errors > 0){ echo "<font size=\"2\" color=\"#ff0000\">".$form->num_errors." error(s) found</font>"; } ?> <form action="process.php" method="POST"> <table align="left" border="0" cellspacing="0" cellpadding="3"> <tr><td>Username:</td><td><input readonly type="text" name="user" maxlength="30" value="<? echo "Admin"; ?>"></td><td><? echo $form->error("user"); ?></td></tr> <tr><td>Password:</td><td><input readonly type="password" name="pass" maxlength="30" value="<? echo "vvstgy"; ?>"></td><td><? echo $form->error("pass"); ?></td></tr> <tr><td colspan="2" align="left"><input type="checkbox" name="remember" <? if($form->value("remember") != ""){ echo "checked"; } ?>> <font size="2">Remember me next time <input type="hidden" name="sublogin" value="1"> <input type="submit" value="Login"></td></tr> <tr><td colspan="2" align="left"><br><font size="2">[<a href="forgotpass.php">Forgot Password?</a>]</font></td><td align="right"></td></tr> <tr><td colspan="2" align="left"><br>Not registered? <a href="register.php">Sign-Up!</a></td></tr> </table> </form> <? } /** * Just a little page footer, tells how many registered members * there are, how many users currently logged in and viewing site, * and how many guests viewing site. Active users are displayed, * with link to their user information. */ echo "</td></tr><tr><td align=\"center\"><br><br>"; echo "<b>Member Total:</b> ".$database->getNumMembers()."<br>"; echo "There are $database->num_active_users registered members and "; echo "$database->num_active_guests guests viewing the site.<br><br>"; include("include/view_active.php"); ?> </td></tr> </table> </body> </html> Quote Link to comment Share on other sites More sharing options...
Skewled Posted June 3, 2012 Share Posted June 3, 2012 echo "<tr><td>[<a href=\"process.php\">Logout</a>]</td></tr>"; } </article> else{ ?> add </section> above article and give that a go. If you get the error then you have to remove both </section> and </article> that have been added. I know the issue is with the div for that content, just need to think it through to correct the layout now.. Quote Link to comment Share on other sites More sharing options...
wezze Posted June 3, 2012 Author Share Posted June 3, 2012 ok when i delete </section> and </article> i get my page back but the layout isnt good http://mcbevers.be/login/index.php thx Quote Link to comment Share on other sites More sharing options...
Skewled Posted June 3, 2012 Share Posted June 3, 2012 The CSS is all that's left to work on, I need to look at the code again.. give me a minute.. Quote Link to comment Share on other sites More sharing options...
Skewled Posted June 3, 2012 Share Posted June 3, 2012 For the site at this moment it's a CSS issue and I have to run for now, but the <article> and <section> CSS are empty because the login form is no longer required when you log in so something has to fill the void to move the other elements back in place. I'll see what I can do when I get back home in a few hours, but I encourage you to tweak the CSS portion and possibly make sure the <section> and <article> areas have content, then it should all adjust properly and fit in place. Quote Link to comment Share on other sites More sharing options...
wezze Posted June 3, 2012 Author Share Posted June 3, 2012 the loggin needs to be replaced with this code so you get the links instead of the login when logged <? /** * User has already logged in, so display relavent links, including * a link to the admin center if the user is an administrator. */ if($session->logged_in){ echo '<h1><img src="images/lock_unlocked.png" width="32" height="32">Logged In</h1>'; echo "<table width='600' cellpadding='5' cellspacing='5' border='1'>"; echo "<p>Welcome <b>$session->username</b></p> <br/><br/>" ."<tr><td>[<a href=\"userinfo.php?user=$session->username\">My Account</a>]</td></tr>" ."<tr><td>[<a href=\"useredit.php\">Edit Account</a>]</td></tr>"; if($session->isAdmin()){ echo "<tr><td>[<a href=\"admin/admin.php\">Admin Center</a>]</td></tr>"; echo "<tr><td>[<a href=\"../gastenboek/admin/index.php\">Gastenboek</a>]</td></tr>"; echo "<tr><td>[<a href=\"../livre d'or/admin/index.php\">livre d'or</a>]</td></tr>"; echo "<tr><td>[<a href=\"../upload/upload.form.php\">upload</a>]</td></tr>"; } echo "<tr><td>[<a href=\"process.php\">Logout</a>]</td></tr>"; } else{ ?> ill have a look at it tommorow causse its almost bed time over here. tyvm for the help kadeous Quote Link to comment Share on other sites More sharing options...
Skewled Posted June 3, 2012 Share Posted June 3, 2012 <article> <? /** * User has already logged in, so display relavent links, including * a link to the admin center if the user is an administrator. */ if($session->logged_in){ echo '<h1><img src="images/lock_unlocked.png" width="32" height="32">Logged In</h1>'; echo "<table width='600' cellpadding='5' cellspacing='5' border='1'>"; echo "<p>Welcome <b>$session->username</b></p> <br/><br/>" ."<tr><td>[<a href=\"userinfo.php?user=$session->username\">My Account</a>]</td></tr>" ."<tr><td>[<a href=\"useredit.php\">Edit Account</a>]</td></tr>"; if($session->isAdmin()){ echo "<tr><td>[<a href=\"admin/admin.php\">Admin Center</a>]</td></tr>"; echo "<tr><td>[<a href=\"../gastenboek/admin/index.php\">Gastenboek</a>]</td></tr>"; echo "<tr><td>[<a href=\"../livre d'or/admin/index.php\">livre d'or</a>]</td></tr>"; echo "<tr><td>[<a href=\"../upload/upload.form.php\">upload</a>]</td></tr>"; } echo "<tr><td>[<a href=\"process.php\">Logout</a>]</td></tr>"; } else{ ?> </article> Wrap that in <article> </article> so it will be considered an article as opposed to just sitting on the page. The reason it was an error before is because I did it within the <? ?> php tags... Shouldn't give you an error this time and should hopefully render the page properly. Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted June 4, 2012 Share Posted June 4, 2012 Wezze, when posting code, enclose it within the forum's . . . BBCode tags. Quote Link to comment Share on other sites More sharing options...
wezze Posted June 4, 2012 Author Share Posted June 4, 2012 ok page still showing but not how it should be. you said its prob a css thing want me to post the css file? im moving some stuff on my page, sometimes it shows sometimes it doesnt. I also checked google and found this http://www.w3schools.com/php/php_includes.aspi was looking for something like this when i started the site but didnt find it maybe this could be a solution only i wouldnt know how to start this:s ill have another go when my kids asleep this afternoon cant concentrate with his noise Will do pikachu. thanks Quote Link to comment Share on other sites More sharing options...
wezze Posted June 4, 2012 Author Share Posted June 4, 2012 So im triyng to get this to work now this is on my main page if it works ill try it on my login page later. indexnl.php <div id="wrapper"> <nav> <ul class="lang"><?php include("includes/lang.php"); ?></ul> <ul class="menu"><?php include("includes/menu.php"); ?></ul> </nav> menu.php <li><a class="active" title="home" href="indexnl.html">Home</a></li> <li><a title="Leden" href="ledennlp1.html">Leden</a></li> <li><a title="Album" href="albumnl.html">Album</a></li> <li><a title="Kalender" href="kalendernl.html">Kalender</a></li> <li><a title="Contact" href="contactnl.html">Contact</a></li> now is this the correct way to do it? thx Quote Link to comment Share on other sites More sharing options...
wezze Posted June 4, 2012 Author Share Posted June 4, 2012 ok so i moved some code and implented the include but still not showing correctly this is the new page <? include("include/session.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>Mc Bevers home</title> <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen"/> <!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]--> <!--<link rel="stylesheet" type="text/css" href="css/styles.css" />--> <!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" src="script.js"></script>--> </head> <body> <div id="wrapper"> <nav> <ul class="lang"><?php include("../includes/subs/lang_nl.php"); ?></ul> <ul class="menu"><?php include("../includes/subs/menu_nl.php"); ?></ul> </nav> <header><?php include("../includes/subs/header.php"); ?></header> <section id="main" class="clearfix"> <section id="content"> <article> <? /** * User has already logged in, so display relavent links, including * a link to the admin center if the user is an administrator. */ if($session->logged_in){ echo '<h1><img src="images/lock_unlocked.png" width="32" height="32">Logged In</h1>'; echo "<table width='600' cellpadding='5' cellspacing='5' border='1'>"; echo "<p>Welcome <b>$session->username</b></p> <br/><br/>" ."<tr><td>[<a href=\"userinfo.php?user=$session->username\">My Account</a>]</td></tr>" ."<tr><td>[<a href=\"useredit.php\">Edit Account</a>]</td></tr>"; if($session->isAdmin()){ echo "<tr><td>[<a href=\"admin/admin.php\">Admin Center</a>]</td></tr>"; echo "<tr><td>[<a href=\"../gastenboek/admin/index.php\">Gastenboek</a>]</td></tr>"; echo "<tr><td>[<a href=\"../livre d'or/admin/index.php\">livre d'or</a>]</td></tr>"; echo "<tr><td>[<a href=\"../upload_album/upload.form.php\">upload album</a>]</td></tr>"; echo "<tr><td>[<a href=\"../upload_kalender/upload.form.php\">upload kalender</a>]</td></tr>"; } echo "<tr><td>[<a href=\"process.php\">Logout</a>]</td></tr>"; } else{ ?> </article> <article> <? /** * User not logged in, display the login form. * If user has already tried to login, but errors were * found, display the total number of errors. * If errors occurred, they will be displayed. */ if($form->num_errors > 0){ echo "<p><font size=\"2\">".$form->num_errors." error(s) found</font></p>"; } ?> <section id="form1"> <h3>Login</h3> <form action="process.php" method="post"> <p><label>Gebruikers naam</label></p> <input type="text" name="user" maxlength="30" value="<? echo $form->value("user"); ?>"><? echo $form->error("user"); ?> <p><label>Wachtwoord</label></p> <input type="password" name="pass" maxlength="30" value="<? echo $form->value("pass"); ?>"><? echo $form->error("pass"); ?> <p><label>Onthoud mij </label><input type="checkbox" name="remember" <? if($form->value("remember") != ""){ echo "checked"; } ?>> <input type="hidden" name="sublogin" value="1"> <p><input type="submit" value="Login"></p> <!--<font size="2">[<a href="forgotpass.php">Wachtwoord vergeten?</a>]</font> <p>Nog niet geregistreerd? <a href="register.php">Aanmelden!</a></p>--> </form> </section> </article> </section> <? } ?> <aside id="sidebar"> <ul class="clearfix"><?php include("../includes/subs/side_menu_nl.php"); ?></ul> </aside> </section> <footer> <section id="templatecopy"><?php include("../includes/subs/templatecopy.php"); ?></section> <? /** * Just a little page footer, tells how many registered members * there are, how many users currently logged in and viewing site, * and how many guests viewing site. Active users are displayed, * with link to their user information. */ echo "<center><b>Totaal leden:</b>".$database->getNumMembers()."<br/></center>"; echo "<center>Er zijn $database->num_active_users geregistreerde leden en "; echo "$database->num_active_guests gasten online.</center>"; include("login/include/view_active.php"); ?> </footer> </div> </body> </html> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.