
http://zetolic.com/social/ try and register, register apparently works but the login doesn't and theres nothing in phpmyadmin
Last edited by Colin-Roberts; 13-12-2008 at 05:08 PM.
.:.:#14:.:. .:.: Impossible Is Nothing :.:. .:.: 845 Rep:.:.
.:.: Stand up for what is right, even if you stand alone:.:.
Hmm, strange.http://zetolic.com/social/ try and register, register apparently works but the login doesn't and theres nothing in phpmyadmin
I've done a core, similar to yours, that has the line:
But I get this error;PHP Code:$check_ban_number = mysql_fetch_object( $check_ban );
Any ideas, is it worth contacting host or is it a bad php mistake?Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in \\nas-001\winspace002\10-didehvar.com\www\fivid\includes\core.php on line 23
Full File:
( do you like my fivid copy? ) ( and this is only for a personal project)
PHP Code:<?
session_start();
/*
_ _ _ _
| _ _| | |
| |_ _(_)_ _ (_) __| |
| _ _| | \ / /| |/ _ |
| | | |\ V / | | (_) |
|_| |_| \_(c)|_|\__,_|
core.
Code & graphics copyrighted (c).
Created by.
*/
mysql_connect( 'i loled, i posted these details' );
mysql_select_db( 'user_data' );
$username = $_SESSION['username'];
$check_ban = mysql_query( "SELECT * FROM `user_data` WHERE `username` = '$username'");
$check_ban_number = mysql_fetch_object( $check_ban );
if ( $check_ban_number->banned == 'true' );
{
echo("Sorry, you have been banned for: " . $check_ban_number->ban_reason);
session_destroy();
exit();
}
?>
Last edited by Jam-ez; 13-12-2008 at 11:15 PM.
Ensure that you have fields named "username", "ban_reason", "banned"I've done a core, similar to yours, that has the line:
But I get this error;PHP Code:$check_ban_number = mysql_fetch_object( $check_ban );
Any ideas, is it worth contacting host or is it a bad php mistake?
Full File:
( do you like my fivid copy? ) ( and this is only for a personal project)
PHP Code:<?
session_start();
/*
_ _ _ _
| _ _| | |
| |_ _(_)_ _ (_) __| |
| _ _| | \ / /| |/ _ |
| | | |\ V / | | (_) |
|_| |_| \_(c)|_|\__,_|
core.
Code & graphics copyrighted (c).
Created by.
*/
mysql_connect( 'i loled, i posted these details' );
mysql_select_db( 'user_data' );
$username = $_SESSION['username'];
$check_ban = mysql_query( "SELECT * FROM `user_data` WHERE `username` = '$username'");
$check_ban_number = mysql_fetch_object( $check_ban );
if ( $check_ban_number->banned == 'true' );
{
echo("Sorry, you have been banned for: " . $check_ban_number->ban_reason);
session_destroy();
exit();
}
?>
Just added myself to the table, and still doesn't work. I do have all them fields...
Anyone have any ideas?
Edit: Found problem, I was connecting to table instead of database.
(DUH)
Edit2: Now it's saying I'm banned, when I'm not even logged in and the field isn't set to true..
Last edited by Jam-ez; 14-12-2008 at 11:26 AM.
Can't edit:
Is it because its doing this:
But the session username hasn't been set?PHP Code:$username = $_SESSION['username'];
$check_ban = mysql_query( "SELECT * FROM `user_data` WHERE `username` = '$username'");
If I remember correctly, I removed the ban code.
And the session hasn't been set, it's so $username can be called instead of $_SESSION[ 'username' ]
Want to hide these adverts? Register an account for free!