Jump to content

Recommended Posts

i got a login page that when the form is displayed everything is normal but 1s logged it shows rlly weird i asked this in the php section but they told me to ask it here.

 

http://mcbevers.be/login/index.phpthis is the site you can login with test1 pass test to see it

 

and this is the 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"><?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>

<?
/**
* 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{
?>
<?
/**
* 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>


<? } ?>
<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>

 

Any1 got an idea?

thx

Link to comment
https://forums.phpfreaks.com/topic/263716-web-page-wont-display-the-way-it-should/
Share on other sites

See if his helps, plug your URL in here

 

http://validator.w3.org/

 

This is a usefull site, it says you have 32 errors, it seems most are because you defined your site as strict.

 

I use <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

Also get and use firefoxes firebug it displays colored fields to help you see whats what.

in IE chrome and FF when i log in my side bar is on the wrong way and at the buttom theres some links they need to be where the the side bar is now. if i log out the page shows good so it needs to be like that when you log in exept for the log form then.

 

 

thx

this is from the firebug i dont get why he is showing the table as last here it should be under the welcome admin

<section id="main" class="clearfix">
<section id="content">
<article>
<h1>
<p>
Welcome
<b>Admin</b>
</p>
<center>
<b>Totaal leden:</b>
3
<br>
</center>
<center>Er zijn 1 geregistreerde leden en 0 gasten online.</center>
<table width="600" cellspacing="5" cellpadding="5" border="1">
</article>
</section>
</section>

 

this is the php file

<?
include("include/session.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html 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>"
."<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{
?>
<?
/**
* 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>

Firebug shows for the footer:

<section id="footertop">
<section id="templatecopy">
</section>
</section>

 

So that appears to be opened and closed correctly.

 

Now the below code is for what is contained in the footer:

 

<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");

?>

 

The CSS applied to that:

 

section#templatecopy {
    border-top: 1px dotted #333333;
    clear: both;
    font-size: 12px;
    line-height: 22px;
    padding: 20px;
    text-align: center;
    width: 900px;
}

 

It was displaying the footer correctly but then you moved the templatecopy into the footer and lost the contents from what I can see. It was:

<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>

 

Make sure that the css file is correct and has those items defined in it, revert it and see what you get.. the footer will probably appear again. Then work from there moving the css into the stylesheet and see what happens from there. footertop, footer-column have appeared to vanish from the new modifications.

 

I also want to applaud you on fixing what you have, I know it's frustrating at times but it's really the best way to learn.. trial and error.

thx it gave me a headache at 1 point but im glad it works. maybe i was to fast in making a threath but it was alrdy a week i was trying to fix it.

I still have ALLOT to learn tho. ;)

 

anyway thx Kadeous for pointing me in the right direction!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.