aka J Love Community Supporter?
Bill Gates is my home boy
Gender:
Posts: 884
1636 credits Members referred : 4
« Reply #2 on: Jan 21, 2007, 05:02:32 PM »
hmm so how do i accomplish the same task and remove it from repeating in this loop?
edit- after rexamining the code i noticd that i included login.php inside of the incorrect password coding, where the name of the page u see for that code is already login.php, created a new page login_panel.php which is the code for displaying the login box , and then included that instead, along with some other syntax changes
new code
Code:
<?php ob_start(); require("config.php"); if (!$logged['username']){ if (!$_POST['login']){ include('login_panel.php'); } if ($_POST['login']){ $username = $_POST['username']; $password = md5($_POST['password']); $info = mysql_query("SELECT * FROM users WHERE username = '".$username."'") or die(mysql_error()); $data = mysql_fetch_array($info); if($data['password'] != $password){ echo "<B>Incorrect username or password!</B><br>\n"; include('login_panel.php'); } else { $query = mysql_query("SELECT * FROM users WHERE username = '".$username."'") or die(mysql_error()); $user = mysql_fetch_array($query); setcookie("id", $user['id'],time()+(60*60*24*5), "/", ""); setcookie("pass", $user['password'],time()+(60*60*24*5), "/", ""); echo "<meta http-equiv='Refresh' content=\"'0'; URL='http://www.sleekpixel.net'\">Thank You! Please wait for page refresh.\n"; } } } else { $new = mysql_query("SELECT * FROM pmessages WHERE unread = 'unread' AND touser = ".$logged['username']); $new = mysql_num_rows($new); echo ("<meta http-equiv='Refresh' content=\"'0'; URL='http://www.sleekpixel.net'\">Thank You! Please wait for page refresh.\n"); } ?>