sniperscope Posted January 4, 2009 Share Posted January 4, 2009 hi guys finally i finished my web site but i extremely need feedback form you gurus. my web site works good but when i try to login i got header error. http://kakuhaku.freehostia.com/index.php this is my site. but i did not finish it yet about header picture or other small details. Thanks for your interest and for feedbacks. Regards Quote Link to comment Share on other sites More sharing options...
premiso Posted January 4, 2009 Share Posted January 4, 2009 Show the code, the actual site will not help us solve your problem. Quote Link to comment Share on other sites More sharing options...
jonsjava Posted January 4, 2009 Share Posted January 4, 2009 put the login at the top of the index page (not the form, just the script that says "if they are trying to login, execute this script"). I don't know your code, so I'm not sure which method you are using to handle the login, so I can't give any better answer. Quote Link to comment Share on other sites More sharing options...
sniperscope Posted January 4, 2009 Author Share Posted January 4, 2009 Here is login.php <?php if (!isset($_SESSION)) { session_start(); } ?> <tr> <td width="201" height="157" valign="top"> <?php if (isset($_SESSION['MM_Username'])) { include 'col_left.php'; } else { include 'left_login_panel.php'; } ?> </td> <td width="529" valign="top"> <ul> <li>This site was built by a gaijin</li> <li>There is no responsible for any contets</li> <li>etc...etc...etc</li> </ul> </td> <td width="109" valign="top"> </td> </tr> And this is the login.php <?php require_once('../Connections/user_login.php'); if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } mysql_select_db($database_user_login, $user_login); $query_Rs_user_login = "SELECT Nick_Name, Member_Sfr FROM usr_tbl"; $Rs_user_login = mysql_query($query_Rs_user_login, $user_login) or die(mysql_error()); $row_Rs_user_login = mysql_fetch_assoc($Rs_user_login); $totalRows_Rs_user_login = mysql_num_rows($Rs_user_login); ?> <?php $loginFormAction = $_SERVER['PHP_SELF']; if (isset($_GET['accesscheck'])) { $_SESSION['PrevUrl'] = $_GET['accesscheck']; } if (isset($_POST['user_id'])) { $loginUsername=$_POST['user_id']; $password=$_POST['password']; $MM_fldUserAuthorization = ""; $MM_redirectLoginSuccess = "user_panel.php"; $MM_redirectLoginFailed = "error.php"; $MM_redirecttoReferrer = false; mysql_select_db($database_user_login, $user_login); $LoginRS__query=sprintf("SELECT Nick_Name, Member_Sfr FROM usr_tbl WHERE Nick_Name=%s AND Member_Sfr=%s", GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); $LoginRS = mysql_query($LoginRS__query, $user_login) or die(mysql_error()); $loginFoundUser = mysql_num_rows($LoginRS); if ($loginFoundUser) { $loginStrGroup = ""; $_SESSION['MM_Username'] = $loginUsername; $_SESSION['MM_UserGroup'] = $loginStrGroup; if (isset($_SESSION['PrevUrl']) && false) { $MM_redirectLoginSuccess = $_SESSION['PrevUrl']; } header("Location: " . $MM_redirectLoginSuccess ); } else { header("Location: ". $MM_redirectLoginFailed ); } } ?> <form action="<?php echo $loginFormAction; ?>" name="login" method="POST"> <table width="189" height="64" border="0" cellpadding="0" cellspacing="0" onfocus="MM_validateForm('user_id','','R','password','','R');return document.MM_returnValue"> <tr> <td height="17" colspan="2" valign="TOP">Login Panel<br> <img src="images/hl.gif"><br><br></td> </tr> <tr> <td width="93" height="16" valign="TOP">User Name :</td> </tr> <tr> <td width="96" valign="TOP"><input type="text" name="user_id" id="user_id" size="16" /></td> </tr> <tr> <td height="15" valign="TOP">Pass Word :</td> </tr> <tr> <td height="15" valign="TOP"><input type="password" name="password" id="password" size="16" /></td> </tr> <tr> <td height="16" valign="TOP"> <input type='submit' style='font:10pt Arial; border:1 solid darkblue;cursor:hand;background:#66CCFF' value='Submit' /> </td> </tr> </table> </form> <?php mysql_free_result($Rs_user_login); ?> I have many pages and all of them basically work almost same. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.