Jump to content

Recommended Posts

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

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

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.