Log in

View Full Version : new problem...



Demonicman
03-03-2007, 01:51 AM
ok this is getting rediculous but im so dumb and all of you are smart...

go to www.kalrith.com/add.php
register
go to www.kalrith.com/account.php

now if you dont see the points then i did something wrong, because when i tested it on wamp, it worked perfectly, posted the points and everything, but NOOO it doesnt work on my actual website -.-

here is the mysql table


CREATE TABLE users (ID MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(60), password VARCHAR(60), points INT)

here is the account code (in the mysql table it does say 20 so that is not a problem)



<?php
// Connects to your Database
// Info deleted for mysql logon :)

//checks for login
if(isset($_COOKIE['ID_my_site']))
{
// Collects data from users table
$username = $_COOKIE['ID_my_site'];
$pass = $_COOKIE['Key_my_site'];
$check = mysql_query("SELECT * FROM users 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");
}

//member area is here
else
{
?>
<?php include("head.php"); ?>
<center>
<table border = 1 bgcolor="black" width="70&#37;">
<tr>
<th bgcolor="black">
<font color="00ff00">
<h2>Your Username: <?php echo $username; ?> </h2><p>
<h2>Your Points: <?php echo $info['points']; ?></h2><br />
Under Construction!
</font>
</th>
</tr>
</table>
</center>
<?php include("foot.php"); ?>
<?php
}
}
}
else

//if not a member is shown this
{
?>
<?php include("head.php"); ?>
<h2><center><font color="white">
You need to be signed in to have an account page!!
</font></center></h2>
<?php include("foot.php"); ?>
<?php
}
?>

dont get me wrong i could care less about my post count on here, i just keep running into problems and so far everyone here has been great about helping out

thetestingsite
03-03-2007, 01:54 AM
I don't see anything about points in your mysql table (the code posted above). You may want to add that field in there or see if it is added to your mysql table and just didn't post it here. Either way, that would most likely be the problem.

EDIT: Sorry, seen that you had posted it has the value of 20 in the db. Will look into the problem a little bit more.

Hope this helps.

Demonicman
03-03-2007, 01:56 AM
oh oops lol sorry it should say points INT

but thats not the problem lol i just copied it from the wrong thing :)

thetestingsite
03-03-2007, 02:01 AM
The code looks fine to me (syntax wise as far as it should be working code I should say). You may want to check and see if it is getting an info from the sql query. Try making a seperate page with just the mysql_query and echo every possible column in the table. If one is blank, (or nothing shows up at all) then you know something is wrong with the query.

Hope this helps.

Demonicman
03-03-2007, 02:09 AM
nope 20 shows up... thats not the problem

thetestingsite
03-03-2007, 02:19 AM
I don't know then, like I said before the code looks like it would work syntax wise. The only thing that would be causing it to do this would be if the mysql_query wasn't returning any results. Perhaps someone else can spot the problem.

Sorry I can help much more.

Demonicman
03-03-2007, 02:58 AM
FIXED! i figured it out (dont know how)