TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 01-29-2008, 02:12 PM   #1 (permalink)
Super Moderator
Inquisitive 
 
codefreek's Avatar
 
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
codefreek is on a distinguished road
Help made a login for admin (need help)

hello, as i am learning php i just work out of my ass sort of speek
so this is one try so please dont flame me or so on, and try to be as clear about the things you explain to me thank you.
PHP Code:
<?php
include 'config.php';

if(@
$_POST['submit']=="log")
$ert mysql_query("SELECT * FROM `cms` WHERE `username`,`password`, `rank` = '0'");
while (
$row mysql_fetch_array($ertMYSQL_NUM)) {
if(
$username == $row['username'] && $md5password == $row['password']){
                
$_SESSION['loggedIn'] = true;

// check the rank
if $_session['loggedIn'] == true;
print 
"admin pannel open";
elseif 
$_SESSION['loggedIn'] == null;
print 
"Accses Denied";

if 
$ert "0";
print 
"Accses Denied";
elseif
$ert "1";
print 
"you have accses to admin";


<
h2>Please log in:</h2>
<
form method="post" action="<?php echo $PHP_SELF;?>">
Username: <input name="usernamn" type="text" value="" /><br />
Password: <input name="password" type="password" value="" /> 
          <
input name="submit" type="submit" value="log" />



?>

The Question is, what have i done wrong?
and what should i fix.

ps, NO FLAME! please.

ty
Quote:
ps i know i havent defined the Varibals in Mysql,
for username and password but i dont remember how to do it i fix it later :P

Last edited by codefreek : 01-29-2008 at 02:41 PM. Reason: EDIT CODE! - 3
codefreek is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 07:01 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design