Forgot Password / Register
Site Statistics
Total Members: 520
Total Tutorials: 242
Newsest User: 8884244477
Todays Unique Hits: 156
0 Users 2 Guests Online
Forum Index » PHP + MySQL » Style Conflicts Login
Posted on Sunday 10th June 2007 at 09:35 PM
MCP
templates/default/images/noavatar.png's Avatar
Junior Member
My current template is conflicting my login. This is something I have never heard of before. But here is the situation. When I go to my login page it shows the form. Great. Ok, once I login it directs me back to the login form. I know there is something in my template that is conflicting it. Could you help me find out what it is. Below is the code.

login.php
PHP Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Members Area</title>
<link rel='stylesheet' type='text/css' href='../css/style.css' /><script type='text/javascript' src='../js/include.js'></script>
<script type='text/javascript' src='../js/uf.js'></script>
<style type="text/css">
<!--
.style2 {
    color: #910000;
    font-size: 16px;
}
.style4 {color: #FFFFFF}
.style5 {
    font-size: 14px;
    font-weight: bold;
    color: #910000;
}
.style7 {color: #E0E0E0}
-->
</style>
</head>
<body>
<table cellpadding='0' cellspacing='0' width='100%' height='100%'>
    <tr>
        <td align='center'>

            <table cellpadding='0' cellspacing='0' id='sideGradient'>
<tr><td align='center'><div id='header'></div></td></tr>
<tr><td align='center'>
    <table cellpadding='0' cellspacing='0' width='879'>
    <tr><td id='tabsHolder'>
        <table cellpadding='0' cellspacing='0' width='100%'><tr>
        <td width='66%' valign='bottom'><table width="416" cellpadding='0' cellspacing='0' id='tab'>
          <tr>
            <td width="11" class='unselLeft' />        
            <td width="80" class='unselMid'><div align="center"><a href='../index.html'>FFiH News</a></div></td>
            <td width="13" class='unselRight' />        
            <td width="11" class='unselLeft' />        
            <td width="85" class='unselMid'><div align="center"><a href='http://www.youtube.com/FFiH'>FFiH YouTube</a></div></td>
            <td width="13" class='unselRight' />        
            <td width="11" class='unselLeft' />        
            <td width="67" class='unselMid'><div align="center"><a href='../forum/'>The Forum</a></div></td>
            <td width="13" class='unselRight' />        
            <td width="11" class='selLeft' />        
            <td width="89" class='selMid'><div align="center"><a href='login.php'>Members Area </a></div></td>
            <td width="10" class='selRight' />        
            <!-- <td align='right'><font color="#888888">10.10.10.2</font></td> -->
          </tr>
          </table></td>
        </table>
    </td></tr>
    </table>
</td></tr>
<tr><td align='center' height='100%' class='bodyHolder'>
    <table cellpadding='0' cellspacing='0' height='100%' width='878'>
        <tr><td valign='top'>
        <div class="style4" id='alerts'>. </div>

        <table cellpadding='0' cellspacing='0'><tr>
            <td width='126' valign='top' id='navCol'><table cellpadding='0' cellspacing='0' width='120'>
              <tr>
                <td class='navTitle'><br>
                    <br>
                    <br>
                  Main</td>
              </tr>
              <tr>
                <td class='nav'><div class='navLink'><a href='../index.html'>News</a></div></td>
              </tr>
              <tr>
                <td class='nav'><div class='navLink'><a href='../aboutmcp.html'>About MCP</a></div></td>
              </tr>
              <tr>
                <td class='nav'><div class='navLink'><a href='../cast.html'>Cast</a></div></td>
              </tr>
              <tr>
                <td class='nav'><div class='navLink'><a href='../videos.html'>Videos</a></div></td>
              </tr>
              <tr>
                <td class='nav'><div class='navLink'><a href='../comics.html'>Comics</a></div></td>
              </tr>
              <tr>
                <td height='15' />            
              </tr>
              <tr>
                <td class='navTitle'>Community</td>
              </tr>
              <tr>
                <td class='nav'><div class='navLink'><a href='../forum/'>The Forum</a></div></td>
              </tr>
              <tr>
                <td class='nav'><div class='navLink'><a href='../members/login.php'>Members Area </a></div></td>
              </tr>
              <tr>
                <td class='nav'><div class='navLink'><a href='../members/members.php'>Memberlist</a></div></td>
              </tr>
              <tr>
                <td height='15' />            
              </tr>
              <tr>
                <td class='navTitle'>Current Episode</td>
              </tr>
              <tr>
                <td style="padding-bottom: 5px;" align="center"><a href="ep1.html"><img src="../css/imgs/random/ep1.jpg" alt="" width="110" height="110" border="0"></a></td>
              </tr>
            </table></td>
            <td width='754' id='pageContent' valign='top'>
<table cellpadding='0' cellspacing='0' width='100%'><tr><td class='spacer'>
        <table cellpadding='0' cellspacing='0' width='100%'><tr><td width='90%' valign='top' style='padding-left:8px;'></td><td>

        <a href='#bottom'><img src='../css/imgs/downRight.gif' width="12" height="8" border="0" style='float:right' /></a>
        </td>
        </tr></table>
        </td></tr><tr><td><table cellpadding='0' cellspacing='0' width='100%'><tr><td class='content' width='100%' valign='top'>
            <table cellpadding='0' cellspacing='0' width='100%'>
                <tr>
                    <td>
            <div class='post'>
                <table width='100%' cellpadding='0' cellspacing='0'>
                    <tr>

                        <td><h2 class="style2">Members Area</h2>
                          <p><?
   
include("login2.php");
?></td>
                    </tr>
                </table>
            </div></td></tr>
                    </table></td></tr>
                    </table></td></tr>
                    </table></td>    
                    </tr></table>
                    </td></tr>
                
        <tr><td valign='bottom' align='right' style='padding-top:36px'>
        <a name='bottom' />
        
        <table cellpadding='0' cellspacing='0' width='754'>
        <tr><td style='padding-bottom:10px;text-align:center;background:url(../css/imgs/toTop.gif) 50% 2px no-repeat'>
                <a href='#top' class='small'>Back to Top</a>
        </td>
        </tr><tr><td class='small' style='padding-bottom:10px;text-align:center'><p><a class='small' href='../contact.html'>Contact Information</a><br>
                <br>
  © 2007 MESSCast Productions.<br>
          Based on Halo © 1985-2001 Microsoft Corporation.  All rights reserved.<br>
          Microsoft, Bungie and Halo are trademarks of Microsoft Corporation.<br>
          Read our <a class="small"  href="../privacy.html" target="_blank">Privacy Policy</a>.</p>
            </td>
        </tr>
        <tr>
          <td class='small' style='padding-bottom:10px;text-align:center'><br>
            <table cellpadding='0' cellspacing='0' width='100%'>
            <tr>
              <td width='38%' />          
              <td width='25%' align='center' class="small"><a href="http://corporategreen.net/"><img src="http://rvb.roosterteeth.com/assets/images/cg.gif" alt="" width="187" height="25" border="0"><br>
                <br>
              </a>Customized by MESSCast Productions</td>
              <td width='37%' align='right'>&nbsp;</td>
            </tr>
          </table></td>
          </tr>
        </table>
        
        </td></tr>
    </table>
</td></tr>
</table>
</td></tr></table>
<script type='text/javascript' src='../js/wz_tooltip.js'></script>
</body>
</html>
Posted on Sunday 10th June 2007 at 09:36 PM
MCP
templates/default/images/noavatar.png's Avatar
Junior Member
Damnit. lol Ok Here, also, is the login2.php script.

PHP Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<?php

session_start
(); //allows session
include "config.php";
echo 
"<left>";

$getnew mysql_query("SELECT * FROM `privates` WHERE `status` = 'Unread' AND `to` = '$logged[username]';");
$total mysql_num_rows($getnew);

if(
$logged[id]){
//welcomes the member
echo "<b><em>Welcome $logged[username]</em></b><br>";
//shows the user menu
echo "
<table width='100%' border='0' cellpadding='0' cellspacing='0'>
<tr>
  <td><table width='100%' border='0' cellspacing='6' cellpadding='0'>
<tr>
  <td><b>Members Tools</b></td>
  </tr>
<tr>
  <td><a href='pms.php'>Private Messages</a> <b>
$total New</b></td>
  </tr>
<tr>
  <td><a href='blog.php'>My Blog</a></td>
  </tr>
<tr>
  <td><a href='members.php'>Members</a></td>
</tr>
<tr>
  <td><a href='report.php'>Report a User</a></td>
</tr>
<tr>
  <td></td>
</tr>
<tr>
  <td><strong>User CP</strong></td>
</tr>
<tr>
  <td><a href='editprofile.php'>Edit Profile</a></td>
</tr>
<tr>
  <td><a href='avatar.php'>Change Avatar</a></td>
</tr>
<tr>
  <td><a href='changepassword.php'>Change Password</a></td>
</tr>
<tr>
  <td><a href='chpin.php'>Change PIN</a></td>
</tr>
<tr>
  <td></td>
</tr>
<tr>
  <td><b>Admin and Mods</b></td>
</tr>
<tr>
  <td><a href='admin.php'>Admin Panel</a></td>
</tr>
<tr>
  <td><a href='banacp.php'>Ban CP</a></td>
</tr>
<tr>
  <td><a href='repcp.php'>Reports CP</a></td>
</tr>
<tr>
  <td></td>
</tr>
<tr>
  <td><b><a href='logout.php?logout'>Ditch Us (Logout)</a></b></td>
</tr>
</table></td></tr>
</table>"
;
}
else
if(
$logged[pincode]==123){ 
//checks if pincode is default 
echo ("<p class='error'>Your pincode is the default pincode (123) Please change it</p><meta http-equiv=\"refresh\" content=\"5;url=chpin.php\">");
//redirects to the configure pincode

else
//if there trying to login
if(isset($_GET['login'])){
//removes sql injections from the data
$usernamehtmlspecialchars(addslashes($_POST[username])); 
//encrypts the password
$password sha1(md5(md5(sha1(md5(sha1(sha1(md5($_POST[password]))))))));
//gets the username data from the members database
$uinfo mysql_query("SELECT * FROM `members` WHERE `username` = '$username'") or die(mysql_error()); 
//see if the user exists
$checkuser mysql_num_rows($uinfo);
//if user name not found in database error
if($checkuser == '0')
{
echo 
"<p class='error'>Username not found</p>";
}
else
{
//fetch the sql
$udata mysql_fetch_array($uinfo);
//checks see if the account is verified
if($udata[userlevel] == 1) { 
echo 
"<p class='error'>You have not yet verified your account</p>";
}
//if it is continue
else
//if the db password and the logged in password are the same login
if($udata[password] == $password) {
$query mysql_query("SELECT * FROM `members` WHERE `username` = '$username'") or die(mysql_error()); 
//fetchs the sql
$user mysql_fetch_array($query);
//sets the logged session
$_SESSION['id'] = "$user[id]";
$_SESSION['password'] = "$user[password]";

echo 
"<p class='error2'>Logging In...</p>";
//redirects them
echo "<meta http-equiv='Refresh' content='2; URL=login.php'/>";
}
//wrong password
else
{
echo 
"<p class='error'>Incorrect username or password</p>"
}
}
}
else
{
//If not the above show the login form
echo "<form action='login.php?login' method='post'>
<table width='100%'>
  <tr>
    <td width='121'>Username:</td>
    <td width='905'><input type='text' name='username' size='30' maxlength='25'></td>
  </tr>
  <tr>
    <td>Password:</td>
    <td><input type='password' name='password' size='30' maxlength='25'></td>
  </tr>
    <tr>
    <td colspan='2'><left><input type='submit' value='Login'>
<a href='register.php'>Register</a> | <a href='forgotpass.php'>Forgot Password?</a></left></td>
  </tr>
</table>
</form>"
;
}
echo 
"<left>";
?>
Posted on Tuesday 12th June 2007 at 08:06 PM
SkillMaster
templates/default/images/noavatar.png's Avatar
Senior Member
i would not have a clue