PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
ashebrian
Forum Contributor
Posts: 103 Joined: Sat Feb 02, 2008 8:01 pm
Post
by ashebrian » Wed Mar 19, 2008 8:31 pm
I have a page....it displays the information below properly within the <?php ?> tags...........but when i want to move the information to a different place the account details won't display properly as i hoped....... the code is as follows:
Code: Select all
<?php
include("include/session.php");
?>
<html>
<head>
<title>....</title>
<meta name="description" content="..... />
<meta name="keywords" content="......" />
<link href="eeeee.css" rel="stylesheet" type="text/css" />
<script src="seeee/eeee.js" type="text/javascript"></script>
<script src= "seeee/eeeee.js" type="text/javascript"></script>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
</head>
<body>
<!-- Start of Outer table -->
<table class="table1">
<tr>
<td class="td1">
<!-- Banner Div -->
<div class="wrapper">
<div class="header"><br /><br />
<div class="headershops">
<table class="headerphone">
<tr style="width:100%">
<td></td>
<td style="text-align:right; font-size:10px; padding-left:180px; color:#000000">Welcome <b style="color:#FF0000"><?php echo $session->username; ?></b> you are logged in !!</td>
</tr>
</table>
</div>
<table class="maintable">
<tr class="td2">
<td>
[color=#0000FF]<a href="useredit.php">Edit Account</a>[/color]
<span class="header-links"> l </span>
<a href="underConstruction.html" class="header-links">Cart Contents </a>
<span class="header-links"> l </span>
<a href="underConstruction.html" class="header-links">Checkout</a>
<span class="header-links"> l </span>
<a href="underConstruction.html" class="header-links">Site Map</a>
<span class="header-links"> l </span>
<a href="mailto:info@eeeee.com" class="header-links">Enquires</a>
</td>
</tr>
</table>
</div>
<!-- End Banner -->
<!-- Start Content / Nav Table -->
<table class='maintable'>
<tr>
<td class="td3">
<!-- Start Navigation List -->
<div class="navdiv">
<a href="index.html" class="nav-txt">Home</a><br />
<a href="underConstruction.html" class="nav-txt">Products</a><br>
<a href="underConstruction.html" class="nav-txt">Training Seminars</a><br />
<a href="underConstruction.html" class="nav-txt">Education & Science</a><br />
<a href="underConstruction.html" class="nav-txt">Promotional Advice</a><br />
<a href="underConstruction.html" class="nav-txt">PR Media</a><br />
<a href="underConstruction.html" class="nav-txt">Recruitment</a><br />
<a href="underConstruction.html" class="nav-txt">Awards</a><br />
<a href="underConstruction.html" class="nav-txt">Our Team</a><br />
<a href="underConstruction.html" class="nav-txt">Contact Us</a><br /><br />
</div>
</td>
<td class="content">
<!-- Image Sequencer -->
<div class="seqdiv" id="imageContainer">
<img src="images/stock2.gif" alt="" name="stock2" hspace="0" vspace="0" id="stock4" class="stock1" />
<img src="images/stock1.jpg" alt="" name="stock3" hspace="0" vspace="0" id="stock3" />
<img src="images/stock3.jpg" alt="" name="home2" hspace="0" vspace="0" id="stock2" />
<img src="images/stock4.jpg" alt="" name="home2" hspace="0" vspace="0" id="stock2" />
<img src="images/stock5.jpg" alt="" name="stock1" hspace="0" vspace="0" id="stock1" />
<div id='blackLayer'> </div>
</div>
<br />
<script src= "scripts/currentDate.js" type="text/javascript"></script><br />
<table>
<tr><td>
<?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>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{
?>
<h1>Login</h1>
<?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 "<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 type="text" name="user" maxlength="30" value="<?php echo $form->value("user"); ?>"></td><td><?php echo $form->error("user"); ?></td></tr>
<tr><td>Password:</td><td><input type="password" name="pass" maxlength="30" value="<?php echo $form->value("pass"); ?>"></td><td><?php echo $form->error("pass"); ?></td></tr>
<tr><td colspan="2" align="left"><input type="checkbox" name="remember" <?php if($form->value("remember") != ""){ echo "checked"; } ?>>
<font size="2">Remember me next time </font>
<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>
<?php
}
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- Footer Div -->
<div class="push">
</div>
<div class="footer">
<div class='maindiv'>
<a href="underConstruction.html" class="footer-links">Privacy Policy</a>
<span class="footer-links"> | </span>
<a href="underConstruction.html" class="footer-links">Copyright</a>
<span class="footer-links">
<span class="footer-links"> | </span>
</span><a href="underConstruction.html" class="footer-links">Terms & Conditions </a>
<span class="footer-links">
<span class="footer-links"> | </span>
</span><a href="underConstruction.html" class="footer-links">Feedback</a>
</div>
</div>
<!-- End of Outer Table -->
</div>
<!-- Wrapper Div -->
</td>
</tr>
</table>
</body>
</html>
This info is what i want moved to the blue highlighted link:
Code: Select all
<?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>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{
?>
However, if i move the "My Account" link to above the blue location
Code: Select all
[color=#0000FF]<a href="useredit.php">Edit Account</a>[/color]
it doesn't access the database as says the username is not valid. How do i fix this prob? If i leave it where it is originally it works fine but i don't want that. i'm just learning php so please go easy.
ashebrian
Forum Contributor
Posts: 103 Joined: Sat Feb 02, 2008 8:01 pm
Post
by ashebrian » Mon Mar 24, 2008 5:44 pm
any little help would be greatful...i've tried a number of options but couldn't do it
micknc
Forum Contributor
Posts: 115 Joined: Thu Jan 24, 2008 11:13 pm
Post
by micknc » Mon Mar 24, 2008 6:23 pm
Are you moving this:
<a href=\"userinfo.php?user=$session->username\">My Account</a>
or the whole php code?
Post the code that doesn't work. I think that will help.
ashebrian
Forum Contributor
Posts: 103 Joined: Sat Feb 02, 2008 8:01 pm
Post
by ashebrian » Mon Mar 24, 2008 6:44 pm
i'm just moving
Code: Select all
<a href=[color=#FF0000]/[/color]"userinfo.php?user=$session->username[color=#FF0000]/[/color]">My Account</a>
had to get rid of the red inside de code. I'm mainly just redirected to the error page.
If i move the whole code then the rest of the html code below it will disappear....including the footer. and the info works But thats not what i want. i all the info displayed including the footer and the images.
micknc
Forum Contributor
Posts: 115 Joined: Thu Jan 24, 2008 11:13 pm
Post
by micknc » Mon Mar 24, 2008 7:06 pm
Try this code adjustment and let us know what error you get:
Code: Select all
<?php
include("include/session.php");
?>
<html>
<head>
<title>....</title>
<meta name="description" content="..... />
<meta name="keywords" content="......" />
<link href="eeeee.css" rel="stylesheet" type="text/css" />
<script src="seeee/eeee.js" type="text/javascript"></script>
<script src= "seeee/eeeee.js" type="text/javascript"></script>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
</head>
<body>
<!-- Start of Outer table -->
<table class="table1">
<tr>
<td class="td1">
<!-- Banner Div -->
<div class="wrapper">
<div class="header"><br /><br />
<div class="headershops">
<table class="headerphone">
<tr style="width:100%">
<td></td>
<td style="text-align:right; font-size:10px; padding-left:180px; color: 000000">
<? if($session->logged_in){
echo "<h1>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>"; ?>
</td>
</tr>
</table>
</div>
<table class="maintable">
<tr class="td2">
<td>
<a href="useredit.php">Edit Account</a>
<span class="header-links"> l </span>
<a href="underConstruction.html" class="header-links">Cart Contents </a>
<span class="header-links"> l </span>
<a href="underConstruction.html" class="header-links">Checkout</a>
<span class="header-links"> l </span>
<a href="underConstruction.html" class="header-links">Site Map</a>
<span class="header-links"> l </span>
<a href="mailto:info@eeeee.com" class="header-links">Enquires</a>
</td>
</tr>
</table>
</div>
<!-- End Banner -->
<!-- Start Content / Nav Table -->
<table class='maintable'>
<tr>
<td class="td3">
<!-- Start Navigation List -->
<div class="navdiv">
<a href="index.html" class="nav-txt">Home</a><br />
<a href="underConstruction.html" class="nav-txt">Products</a><br>
<a href="underConstruction.html" class="nav-txt">Training Seminars</a><br />
<a href="underConstruction.html" class="nav-txt">Education & Science</a><br />
<a href="underConstruction.html" class="nav-txt">Promotional Advice</a><br />
<a href="underConstruction.html" class="nav-txt">PR Media</a><br />
<a href="underConstruction.html" class="nav-txt">Recruitment</a><br />
<a href="underConstruction.html" class="nav-txt">Awards</a><br />
<a href="underConstruction.html" class="nav-txt">Our Team</a><br />
<a href="underConstruction.html" class="nav-txt">Contact Us</a><br /><br />
</div>
</td>
<td class="content">
<!-- Image Sequencer -->
<div class="seqdiv" id="imageContainer">
<img src="images/stock2.gif" alt="" name="stock2" hspace="0" vspace="0" id="stock4" class="stock1" />
<img src="images/stock1.jpg" alt="" name="stock3" hspace="0" vspace="0" id="stock3" />
<img src="images/stock3.jpg" alt="" name="home2" hspace="0" vspace="0" id="stock2" />
<img src="images/stock4.jpg" alt="" name="home2" hspace="0" vspace="0" id="stock2" />
<img src="images/stock5.jpg" alt="" name="stock1" hspace="0" vspace="0" id="stock1" />
<div id='blackLayer'> </div>
</div>
<br />
<script src= "scripts/currentDate.js" type="text/javascript"></script><br />
<table>
<tr><td>
<?php
}
else{
?>
<h1>Login</h1>
<?php
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 type="text" name="user" maxlength="30" value="<?php echo $form->value("user"); ?>"></td><td><?php echo $form->error("user"); ?></td></tr>
<tr><td>Password:</td><td><input type="password" name="pass" maxlength="30" value="<?php echo $form->value("pass"); ?>"></td><td><?php echo $form->error("pass"); ?></td></tr>
<tr><td colspan="2" align="left"><input type="checkbox" name="remember" <?php if($form->value("remember") != ""){ echo "checked"; } ?>>
<font size="2">Remember me next time </font>
<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>
<?php
}
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- Footer Div -->
<div class="push">
</div>
<div class="footer">
<div class='maindiv'>
<a href="underConstruction.html" class="footer-links">Privacy Policy</a>
<span class="footer-links"> | </span>
<a href="underConstruction.html" class="footer-links">Copyright</a>
<span class="footer-links">
<span class="footer-links"> | </span>
</span><a href="underConstruction.html" class="footer-links">Terms & Conditions </a>
<span class="footer-links">
<span class="footer-links"> | </span>
</span><a href="underConstruction.html" class="footer-links">Feedback</a>
</div>
</div>
<!-- End of Outer Table -->
</div>
<!-- Wrapper Div -->
</td>
</tr>
</table>
</body>
</html>
ashebrian
Forum Contributor
Posts: 103 Joined: Sat Feb 02, 2008 8:01 pm
Post
by ashebrian » Mon Mar 24, 2008 7:29 pm
cheers... worked....i swore i tried that myself. maybe my refresh button didn't work properly at that stage
micknc
Forum Contributor
Posts: 115 Joined: Thu Jan 24, 2008 11:13 pm
Post
by micknc » Mon Mar 24, 2008 7:40 pm
Post that whole page that you have now... Something small is out of place
ashebrian
Forum Contributor
Posts: 103 Joined: Sat Feb 02, 2008 8:01 pm
Post
by ashebrian » Mon Mar 24, 2008 7:55 pm
Damn....ur right. just one area now. a small prob
Code: Select all
<?php
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 xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta name="description" content="" />
<meta name="keywords" content="" />
<link href="eeee.css" rel="stylesheet" type="text/css" />
<script src="sssss.js" type="text/javascript"></script>
<script src= "ssss.js" type="text/javascript"></script>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
</head>
<body>
<!-- Start of Outer table -->
<table class="table1">
<tr>
<td class="td1">
<!-- Banner Div -->
<div class="wrapper">
<div class="header"><br /><br />
<div class="headershops">
<table class="headerphone">
<tr style="width:100%">
<td></td>
<td style="text-align:right"><img src="images/list-dot-top.gif" alt="" /><img src="images/list-dot-top.gif" alt="" /><img src="images/list-dot-top.gif" alt="" /></td>
</tr>
<tr style="width:100%">
<td style="text-align:center"></td>
<td style="text-align:right"><img src="images/list-dot-top.gif" alt="" /><img src="images/list-dot-top.gif" alt="" /></td>
</tr>
<tr style="width:100%">
<td style="text-align:center"></td>
<td style="text-align:right"></td>
</tr>
<tr style="width:100%">
<td style="text-align:center"></td>
<td style="text-align:right"></td>
</tr>
<tr style="width:100%">
<td style="text-align:center"></td>
<td style="text-align:right"> </td>
</tr>
<tr>
<td></td>
<td style="text-align:right; font-size:10px; padding-left:180px; color:#000000"><?php if($session->logged_in){
echo "<h1>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>"; ?></td>
</tr>
</table>
</div>
<table class="maintable">
<tr class="td2">
<td>
<a href="userinfo.php?user=$session->username">My Account</a>
<span class="header-links"> l </span>
<a href="underConstruction.html" class="header-links">Shopping Cart</a>
<span class="header-links"> l </span>
<a href="underConstruction.html" class="header-links">Checkout</a>
<span class="header-links"> l </span>
<a href="underConstruction.html" class="header-links">Site Map</a>
<span class="header-links"> l </span>
<a href="" class="header-links">Enquires</a>
</td>
</tr>
</table>
</div>
<!-- End Banner -->
<!-- Start Content / Nav Table -->
<table class='maintable'>
<tr>
<td class="td3">
<!-- Start Navigation List -->
<div class="navdiv">
<a href="index.html" class="nav-txt">Home</a><br />
<a href="underConstruction.html" class="nav-txt">Products</a><br>
<a href="underConstruction.html" class="nav-txt">Training Seminars</a><br />
<a href="underConstruction.html" class="nav-txt">Education & Science</a><br />
<a href="underConstruction.html" class="nav-txt">Promotional Advice</a><br />
<a href="underConstruction.html" class="nav-txt">PR Media</a><br />
<a href="underConstruction.html" class="nav-txt">Recruitment</a><br />
<a href="underConstruction.html" class="nav-txt">Awards</a><br />
<a href="underConstruction.html" class="nav-txt">Our Team</a><br />
<a href="underConstruction.html" class="nav-txt">Contact Us</a><br /><br />
</div>
</td>
<td class="td2">
</td>
<td class="content"><br /><br />
<!-- Image Sequencer -->
<div class="seqdiv" id="imageContainer"> <img src="images/stock2.gif" alt="Éalú MediSpa Therapy" name="stock2" hspace="0" vspace="0" id="stock4" class="stock1" />
<img src="images/stock1.jpg" alt="Éalú MediSpa Therapy" name="stock3" hspace="0" vspace="0" id="stock3" />
<img src="images/stock3.jpg" alt="Éalú MediSpa Therapy" name="home2" hspace="0" vspace="0" id="stock2" />
<img src="images/stock4.jpg" alt="Éalú MediSpa Therapy" name="home2" hspace="0" vspace="0" id="stock2" />
<img src="images/stock5.jpg" alt="Éalú MediSpa Therapy" name="stock1" hspace="0" vspace="0" id="stock1" />
<div id='blackLayer'> </div>
</div>
<br />
<script src= "scripts/currentDate.js" type="text/javascript"></script><br />
<table>
<tr><td>
<?php
}
else{
?>
<h1>Login</h1>
<?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 "<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 type="text" name="user" maxlength="30" value="<?php echo $form->value("user"); ?>" /></td><td><?php echo $form->error("user"); ?></td></tr>
<tr><td>Password:</td><td><input type="password" name="pass" maxlength="30" value="<?php echo $form->value("pass"); ?>" /></td><td><?php echo $form->error("pass"); ?></td></tr>
<tr><td colspan="2" align="left"><input type="checkbox" name="remember" <?php if($form->value("remember") != ""){ echo "checked"; } ?> />
<font size="2">Remember me next time </font>
<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>
<?php
}
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- Footer Div -->
<div class="push">
</div>
<div class="footer">
<div class='maindiv'>
<a href="underConstruction.html" class="footer-links">Privacy Policy</a>
<span class="footer-links"> | </span>
<a href="underConstruction.html" class="footer-links">Copyright</a>
<span class="footer-links">
<span class="footer-links"> | </span>
</span><a href="underConstruction.html" class="footer-links">Terms & Conditions </a>
<span class="footer-links">
<span class="footer-links"> | </span>
</span>
</div>
</div>
<!-- End of Outer Table -->
</div>
<!-- Wrapper Div -->
</td>
</tr>
</table>
</body>
</html>
<?
}
?>
The only problem i have is that the login section is not displayed correctly footer is displayed but covering the the field boxes......Also the following links are not visable:
Code: Select all
<a href="userinfo.php?user=$session->username">My Account</a>
<span class="header-links"> l </span>
<a href="underConstruction.html" class="header-links">Shopping Cart</a>
<span class="header-links"> l </span>
<a href="underConstruction.html" class="header-links">Checkout</a>
<span class="header-links"> l </span>
<a href="underConstruction.html" class="header-links">Site Map</a>
<span class="header-links"> l </span>
<a href="mailto:info@ealuspatherapy.com" class="header-links">Enquires</a>
</td>
</tr>
</table>
</div>
<!-- End Banner -->
<!-- Start Content / Nav Table -->
<table class='maintable'>
<tr>
<td class="td3">
<!-- Start Navigation List -->
<div class="navdiv">
<a href="index.html" class="nav-txt">Home</a><br />
<a href="underConstruction.html" class="nav-txt">Products</a><br>
<a href="underConstruction.html" class="nav-txt">Training Seminars</a><br />
<a href="underConstruction.html" class="nav-txt">Education & Science</a><br />
<a href="underConstruction.html" class="nav-txt">Promotional Advice</a><br />
<a href="underConstruction.html" class="nav-txt">PR Media</a><br />
<a href="underConstruction.html" class="nav-txt">Recruitment</a><br />
<a href="underConstruction.html" class="nav-txt">Awards</a><br />
<a href="underConstruction.html" class="nav-txt">Our Team</a><br />
<a href="underConstruction.html" class="nav-txt">Contact Us</a><br /><br />
</div>
micknc
Forum Contributor
Posts: 115 Joined: Thu Jan 24, 2008 11:13 pm
Post
by micknc » Mon Mar 24, 2008 8:04 pm
It looks like the if statement is returning a false. That would be why those links aren't showing up. Lines 51 through 115 are only going to be there if the if is true 116 through 145 if it is false and the rest of the page regardless. So should that be a true statement in your current session?
ashebrian
Forum Contributor
Posts: 103 Joined: Sat Feb 02, 2008 8:01 pm
Post
by ashebrian » Mon Mar 24, 2008 8:22 pm
I don't understand.... i'm a bit lost how would one solve this prob?
would the prob lay ere which is located inside the process.php:
Code: Select all
function procLogin(){
global $session, $form;
/* Login attempt */
$retval = $session->login($_POST['user'], $_POST['pass'], isset($_POST['remember']));
/* Login successful */
if($retval){
header("Location: ".$session->referrer);
}
/* Login failed */
else{
$_SESSION['value_array'] = $_POST;
$_SESSION['error_array'] = $form->getErrorArray();
header("Location: ".$session->referrer);
}
}
But there is no true or false involved in there
micknc
Forum Contributor
Posts: 115 Joined: Thu Jan 24, 2008 11:13 pm
Post
by micknc » Mon Mar 24, 2008 8:33 pm
Line 50 is the true false:
if($session->logged_in)
That is why it is not showing lines 51 through 116
ashebrian
Forum Contributor
Posts: 103 Joined: Sat Feb 02, 2008 8:01 pm
Post
by ashebrian » Mon Mar 24, 2008 8:48 pm
its needed ..... whats ur opinion? If i want the errors to be displayed them i have to use it.
There another way around it?
micknc
Forum Contributor
Posts: 115 Joined: Thu Jan 24, 2008 11:13 pm
Post
by micknc » Mon Mar 24, 2008 10:38 pm
The missing links is the easy part... Just move lines 115 and 116:
}
else{
up to 56 before the </td>
See if that gets you the output that you want (both logged in and not).
That would keep the errors but may give you problems with lines 50 through 56. Try that first and see what you get.
ashebrian
Forum Contributor
Posts: 103 Joined: Sat Feb 02, 2008 8:01 pm
Post
by ashebrian » Tue Mar 25, 2008 4:53 pm
as i have said in one of my previous msg i have tried that....maybe i deleted it.
I tried it again....and the login page is fine as expected
BUT once i login the links and images in the code below are not displayed:
Code: Select all
<div class="seqdiv" id="imageContainer">
<img src="images/stock2.gif" alt="" name="stock2" hspace="0" vspace="0" id="stock4" class="stock1" />
<img src="images/stock1.jpg" alt="" name="stock3" hspace="0" vspace="0" id="stock3" />
<img src="images/stock3.jpg" alt="" name="home2" hspace="0" vspace="0" id="stock2" />
<img src="images/stock4.jpg" alt="" name="home2" hspace="0" vspace="0" id="stock2" />
<img src="images/stock5.jpg" alt="" name="stock1" hspace="0" vspace="0" id="stock1" />
<div id='blackLayer'> </div>
</div>
<br />
<script src= "scripts/currentDate.js" type="text/javascript"></script><br />
and:
Code: Select all
<div class="navdiv">
<a href="index.html" class="nav-txt">Home</a><br />
<a href="underConstruction.html" class="nav-txt">Products</a><br>
<a href="underConstruction.html" class="nav-txt">Training Seminars</a><br />
<a href="underConstruction.html" class="nav-txt">Education & Science</a><br />
<a href="underConstruction.html" class="nav-txt">Promotional Advice</a><br />
<a href="underConstruction.html" class="nav-txt">PR Media</a><br />
<a href="underConstruction.html" class="nav-txt">Recruitment</a><br />
<a href="underConstruction.html" class="nav-txt">Awards</a><br />
<a href="underConstruction.html" class="nav-txt">Our Team</a><br />
<a href="underConstruction.html" class="nav-txt">Contact Us</a><br /><br />
</div>
micknc
Forum Contributor
Posts: 115 Joined: Thu Jan 24, 2008 11:13 pm
Post
by micknc » Tue Mar 25, 2008 6:56 pm
So it looks like the if statement is working fine. Try this:
Code: Select all
<?php
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 xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta name="description" content="" />
<meta name="keywords" content="" />
<link href="eeee.css" rel="stylesheet" type="text/css" />
<script src="sssss.js" type="text/javascript"></script>
<script src= "ssss.js" type="text/javascript"></script>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
</head>
<body>
<!-- Start of Outer table -->
<table class="table1">
<tr>
<td class="td1">
<!-- Banner Div -->
<div class="wrapper">
<div class="header"><br /><br />
<div class="headershops">
<table class="headerphone">
<tr style="width:100%">
<td></td>
<td style="text-align:right"><img src="images/list-dot-top.gif" alt="" /><img src="images/list-dot-top.gif" alt="" /><img src="images/list-dot-top.gif" alt="" /></td>
</tr>
<tr style="width:100%">
<td style="text-align:center"></td>
<td style="text-align:right"><img src="images/list-dot-top.gif" alt="" /><img src="images/list-dot-top.gif" alt="" /></td>
</tr>
<tr style="width:100%">
<td style="text-align:center"></td>
<td style="text-align:right"></td>
</tr>
<tr style="width:100%">
<td style="text-align:center"></td>
<td style="text-align:right"></td>
</tr>
<tr style="width:100%">
<td style="text-align:center"></td>
<td style="text-align:right"> </td>
</tr>
<tr>
<td></td>
<td style="text-align:right; font-size:10px; padding-left:180px; color:#000000"><?php if($session->logged_in){
echo "<h1>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{
?>
<h1>Login</h1>
<?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 "<font size=\"2\" color=\"#ff0000\">".$form->num_errors." error(s) found</font>";
}
?>
</td>
</tr>
</table>
</div>
<table class="maintable">
<tr class="td2">
<td>
<a href="userinfo.php?user=$session->username">My Account</a>
<span class="header-links"> l </span>
<a href="underConstruction.html" class="header-links">Shopping Cart</a>
<span class="header-links"> l </span>
<a href="underConstruction.html" class="header-links">Checkout</a>
<span class="header-links"> l </span>
<a href="underConstruction.html" class="header-links">Site Map</a>
<span class="header-links"> l </span>
<a href="" class="header-links">Enquires</a>
</td>
</tr>
</table>
</div>
<!-- End Banner -->
<!-- Start Content / Nav Table -->
<table class='maintable'>
<tr>
<td class="td3">
<!-- Start Navigation List -->
<div class="navdiv">
<a href="index.html" class="nav-txt">Home</a><br />
<a href="underConstruction.html" class="nav-txt">Products</a><br>
<a href="underConstruction.html" class="nav-txt">Training Seminars</a><br />
<a href="underConstruction.html" class="nav-txt">Education & Science</a><br />
<a href="underConstruction.html" class="nav-txt">Promotional Advice</a><br />
<a href="underConstruction.html" class="nav-txt">PR Media</a><br />
<a href="underConstruction.html" class="nav-txt">Recruitment</a><br />
<a href="underConstruction.html" class="nav-txt">Awards</a><br />
<a href="underConstruction.html" class="nav-txt">Our Team</a><br />
<a href="underConstruction.html" class="nav-txt">Contact Us</a><br /><br />
</div>
</td>
<td class="td2">
</td>
<td class="content"><br /><br />
<!-- Image Sequencer -->
<div class="seqdiv" id="imageContainer"> <img src="images/stock2.gif" alt="Éalú MediSpa Therapy" name="stock2" hspace="0" vspace="0" id="stock4" class="stock1" />
<img src="images/stock1.jpg" alt="Éalú MediSpa Therapy" name="stock3" hspace="0" vspace="0" id="stock3" />
<img src="images/stock3.jpg" alt="Éalú MediSpa Therapy" name="home2" hspace="0" vspace="0" id="stock2" />
<img src="images/stock4.jpg" alt="Éalú MediSpa Therapy" name="home2" hspace="0" vspace="0" id="stock2" />
<img src="images/stock5.jpg" alt="Éalú MediSpa Therapy" name="stock1" hspace="0" vspace="0" id="stock1" />
<div id='blackLayer'> </div>
</div>
<br />
<script src= "scripts/currentDate.js" type="text/javascript"></script><br />
<table>
<tr><td>
<form action="process.php" method="POST">
<table align="left" border="0" cellspacing="0" cellpadding="3">
<tr><td>Username:</td><td><input type="text" name="user" maxlength="30" value="<?php echo $form->value("user"); ?>" /></td><td><?php echo $form->error("user"); ?></td></tr>
<tr><td>Password:</td><td><input type="password" name="pass" maxlength="30" value="<?php echo $form->value("pass"); ?>" /></td><td><?php echo $form->error("pass"); ?></td></tr>
<tr><td colspan="2" align="left"><input type="checkbox" name="remember" <?php if($form->value("remember") != ""){ echo "checked"; } ?> />
<font size="2">Remember me next time </font>
<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>
<?php
}
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- Footer Div -->
<div class="push">
</div>
<div class="footer">
<div class='maindiv'>
<a href="underConstruction.html" class="footer-links">Privacy Policy</a>
<span class="footer-links"> | </span>
<a href="underConstruction.html" class="footer-links">Copyright</a>
<span class="footer-links">
<span class="footer-links"> | </span>
</span><a href="underConstruction.html" class="footer-links">Terms & Conditions </a>
<span class="footer-links">
<span class="footer-links"> | </span>
</span>
</div>
</div>
<!-- End of Outer Table -->
</div>
<!-- Wrapper Div -->
</td>
</tr>
</table>
</body>
</html>
<?
}
?>