whizzykid Posted June 5, 2009 Share Posted June 5, 2009 My code when i try to login using the form on my website it shows url not found and this is the code.and it shows this too <?php echo $loginFormAction; ?> $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 = "profile_".$profile[0] .".php"; $MM_redirectLoginFailed = "normal_layout_01.gif"; $MM_redirecttoReferrer = true; mysql_select_db($database_postycom_profile, $postycom_profile); $LoginRS__query=sprintf("SELECT `User Id`, Password FROM login WHERE `User Id`=%s AND Password=%s", GetSQLValueString($loginUsername, "-1"), GetSQLValueString($password, "int")); $LoginRS = mysql_query($LoginRS__query, $postycom_profile) or die(mysql_error()); $loginFoundUser = mysql_num_rows($LoginRS); if ($loginFoundUser) { $loginStrGroup = ""; //declare two session variables and assign them $_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 ); } } ?> Link to comment https://forums.phpfreaks.com/topic/161052-help-needed/ Share on other sites More sharing options...
MadTechie Posted June 5, 2009 Share Posted June 5, 2009 That problem would be likely be caused by the form.. I'm guessing that you have, <form action="<?php echo $loginFormAction; ?>"> and <?php echo $loginFormAction; ?> is being displayed on the form, this would mean the form isn't being parsed, So.. at a guess i would say your form page is a html file not a php one, so if your form page is called myfrom.html, try changing it to myform.php Link to comment https://forums.phpfreaks.com/topic/161052-help-needed/#findComment-849912 Share on other sites More sharing options...
whizzykid Posted June 5, 2009 Author Share Posted June 5, 2009 hi thanks the form is on the homepage. this is the code for the form. <form method="POST" name="form1" action="<?php echo $loginFormAction; ?>"> <table align="center"> <tr valign="baseline"> <td nowrap align="right">User Id:</td> <td><input name="User_Id" type="text" value="" size="20" maxlength="20"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Password:</td> <td><input name="Password" type="password" value="" size="20" maxlength="20"></td> </tr> <tr valign="baseline"> <td nowrap align="right"> </td> <td><input type="submit" value="Login"></td> </tr> </table> <input type="hidden" name="MM_insert" value="form1"> </form> Link to comment https://forums.phpfreaks.com/topic/161052-help-needed/#findComment-849919 Share on other sites More sharing options...
MadTechie Posted June 5, 2009 Share Posted June 5, 2009 Very nice, but did you read all of my last post ? Link to comment https://forums.phpfreaks.com/topic/161052-help-needed/#findComment-849923 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.