Is this script posting a login to the wrong place?

Hey,

I have setup a site and on 1 section Im using REos - My problem is it is constantly saying logins are wrong - But I know they are right, I created them both by a customer registration page and through the admin panel, verified in phpmyadmin and everything is correct.

I think it is trying to post the login info to the wrong place - I have the script in siteroot/folder and the login script is in root/folder/blocks/

I dont know if its trying to post to a login through the main root or not…

Really hope someone can help, this is the whole login script, its pretty small :slight_smile:

$PHP_SELF = $_SERVER['PHP_SELF'];

if (preg_match("loginform.php/i",$PHP_SELF)) {
    Header("HTTP/1.0 404 Not Found");
    die();
}

//global $_POST;
$this->html_out .="<loginform>";

$this->html_out .="<p class=\\"titlogin\\">"._CUSTZONE."</p>";

$this->html_out .="<p class=\\"txtlogin\\">"._PLEASE_LOGIN." :</p>";

$this->html_out .="<form class=\\"login\\" action=\\"".$this->self_url()."\\" method=\\"post\\">"
                ."<table class=\\"login\\">"
                ."<tr class=\\"login\\">"
                ."<td class=\\"login\\">"._USERNAME.":</td>";
                
if (isset($this->auth["uname"])) $name=htmlentities($this->auth["uname"]);else $name="";

$this->html_out .= "<td class=\\"login\\">\
"
  ."<input class=\\"logininput\\" type=\\"text\\" name=\\"username\\" value=\\"$name\\" size=\\"32\\" maxlength=\\"32\\" />\
"
  ."</td></tr>\
"
  ."<tr class=\\"login\\">\
"
  ."<td class=\\"login\\">"._PASSWORD." :</td>\
"
  ."<td class=\\"login\\"><input class=\\"logininput\\" type=\\"password\\" name=\\"password\\" size=\\"32\\" maxlength=\\"32\\" />\
"
  ."</td></tr>\
"
  ."<tr class=\\"login\\"><td></td>\
"
  ."<td class=\\"login_button\\"><input class=\\"button\\" type=\\"submit\\" name=\\"submit\\" value=\\""._LOGIN_NOW."\\"/>\
"
  ."</td></tr></table>\
";

if ( isset($_POST["username"]) ) {
   //$this->html_out .="<p class=\\"msg_admin\\">"._LOGIN_FAILED."</p>\
";
   $this->add_msg(""._LOGIN_FAILED."");
   }
$this->html_out .="</form>"
."<script type=\\"text/javascript\\">\
"
."if (document.forms[0][0].value != '') document.forms[0][1].focus()\
else document.forms[0][0].focus()\
"
."</script>";
$this->html_out .="<logrem href=\\"".LK_PUBLIC.$this->url_encrypt("pg=remember&nm="._REM_USR)."\\">";
$this->html_out .=_REM_USR."</logrem>";

$this->html_out .="<logrem href=\\"".LK_PUBLIC.$this->url_encrypt("pg=subs&op=1&nm="._SUBS)."\\">";
$this->html_out .=_SUBS."</logrem>";

$this->html_out .="</loginform>";

Anyone have any ideas what the problem could be?
Really appreciate any help :slight_smile:

Thanks!

Thanks for the reply :slight_smile:

This is the login form -I should have included the page that the actual login form is in, sorry!

in members.php

<?php
/**
 * ReOS is a vertical software for real estates.
 * Copyright 2010 IT ELAZOS S.L.
 *
 * This file is part of ReOS v2.x.x.
 *
 * ReOS is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * ReOS is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with ReOS.  If not, see <http://www.gnu.org/licenses/>.
 **/


define("FILE_EXT","_adm");
define("_CRYPT_LINKS",0);
define("_PERMALINKS",0);
require_once("includes/lks_members.php");  // Lista de Hyperlinks
require_once("includes/constants.php");
require_once("includes/class_site_xml.php");

$page=new site;

if ($page->get_page_params()) extract($page->vars);

//************************IDIOMA*********************
//$parm_idma="ca";
if (!isset($_GET["idma"])) $parm_idma=null; else $parm_idma=$_GET["idma"];
    if ($file_idioma=$page->cookie_idioma($parm_idma))
    {
    if (file_exists(_TPLDIR."/"._THEME_DIR."/langs/lang_$file_idioma.php"))
        require_once(_TPLDIR."/"._THEME_DIR."/langs/lang_$file_idioma.php");
    require_once(""._DirLANGS."lang_".$file_idioma.FILE_EXT.".php");
    require_once("includes/globals.php");
    } else {echo "Fail to load Language";die();}
//******************************************************

$page->name = "c14cbf3"; //session name to differentiate from other logins.
//$page->lifetime = 50000; //session time life in minutes
$page->position_table=NULL;
$page->database_table=_TABLE_PREFIX."_accounts";
$page->start();

//$page->align_center=true;

$page->sitename=_LABEL_ORG;
$page->keywords=_KEYWORDS;

if (isset($prt)) $page->file_nav=_TPLDIR."/"._THEME_DIR."/".$prt; else
                 $page->file_nav=_TPLDIR."/"._THEME_DIR."/"._NAVMEMBERS;

if ($page->initiate($id_org_session)) {

$page->vars_ste=$page->get_cookie_state(""._CkSTATE."");
//print_r($page->auth);

if (array_key_exists("pg",$page->vars)) {
   $page->central=NULL;
   $pg=explode(" ",$page->vars["pg"]);
   foreach($pg as $value) $page->add_central(_DirBLOCKS."$value.php");
   unset($pg);
   }

$page->state();

if (isset($nm)) $page->pagetitle=$nm; elseif (array_key_exists("pg",$page->vars) && defined(strtoupper("_".$page->vars["pg"]))) $page->pagetitle=constant(strtoupper("_".$page->vars["pg"]));

}else {$page->vars["nm"]=_HOME;$page->vars["pg"]="loginform";$page->add_central(_DirBLOCKS."loginform.php");$page->state();}
    
//$page->set_cookie_state(""._CkSTATE."",$page->vars["state"]);
$page->out();

$page->freeze();

?>

You can see the script running on my site here.

Thanks once again :slight_smile:

This is the whole script?

The only thing it seems to do with the form data is this:

if ( isset($_POST["username"]) ) {
   //$this->html_out .="<p class=\\"msg_admin\\">"._LOGIN_FAILED."</p>\
";
   $this->add_msg(""._LOGIN_FAILED."");
   }

So whatever username you put in that form, it’ll always give you the login failed message :shifty:

hey, just hoping someone could help with this please, still not having any joy trying to get it working. Thanks!