Reply
Members area of site - only a little help needed
Old 04-16-2008, 04:27 PM Members area of site - only a little help needed
Gilligan's Avatar
Dead Like Me

Posts: 1,608
Name: Stefan
Location: London, UK
Sorry, but if I posted in my 'Updated password in DB' thread then I wouldn't have got anymore replies (problem solved)

My members area of my script should be displaying two options (Manage sites and change account information), and then when they click on one, the page they are taken to displays two different options (for example, they click on account information, and are presented with change password or change email).

Instead, when they click on one, the page they are taken to displays 4 options (the first two, and the other two).

any help??

PHP Code:
<?php include ('/home/a5839198/public_html/inc/config.php'); 

ob_flush();

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>SGilligan :: Home</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../css/style.css">

</head>

<body><div id="main">

<div class="logo">
</div>

<?php echo $iNav ?>     

<div class="content">
<div class="box3">
  <div class="title style1" style="margin-bottom:30px">Client Area</div>
  <div class="iBox">
  
  <?php


$act 
$_REQUEST['act'];
$edit $_REQUEST['edit'];
$manage $_REQUEST['manage'];

//checks cookies to make sure they are logged in
if(isset($_COOKIE['loginsystem0029388172']))
{
$username $_COOKIE['loginsystem0029388172'];
$pass $_COOKIE['systemlogin123ss343d8'];
$check mysql_query("SELECT * FROM members WHERE username = '$username'")or die(mysql_error());
while(
$info mysql_fetch_array$check ))
{

//if the cookie has the wrong password, they are taken to the login page
if ($pass != $info['password'])
header("Location: login.php");
}

//otherwise they are shown the members area
else


echo 
'<a href="members.php?act=edit">Change account details</a>';
echo 
'<a href="members.php?act=manage">Manage sites</a>';
  
  if(
$act == 'edit') {
  
    echo 
'<a href="members.php?edit=pass">Change Password</a>';
    echo 
'<a href="members.php?edit=mail">Change E-Mail</a>';
    
    }
    
   if (
$edit == 'pass') {
                   
$pass2 $_POST['passwordddd'];

             if (empty(
$pass2)) {
             echo 
'<form name="form1" method="post" action="members.php?edit=pass">
             <input type="text" name="passwordddd" />
             <br><input type="submit" value="Change Password">
             </form>'
;
          }
     
             else {
               
             
$pass2 md5($pass2);
             
$pass2 addslashes($pass2);

             
$updatepass "UPDATE members SET password='$pass2' WHERE username='$username'";
             
mysql_query($updatepass) or die(mysql_error());
          
             echo 
'Password changed';
          
          }
     
    
    
    }
     

?>

<?php

}
}
}
else

//if the cookie does not exist, they are taken to the login screen
{
header("Location: login.php");
}

ob_end_flush();

?>
EDIT

Just making it clear , its sorted now, i used an elseif statement.

if(empty($act)) {......}

Last edited by Gilligan : 04-16-2008 at 06:57 PM.
Gilligan is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Reply     « Reply to Members area of site - only a little help needed
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.17098 seconds with 12 queries