HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/RClaassen/stay-on-track.nl/wwwroot/mangsys/inloggen.php
<?php
  $sPagina = $_SERVER['PHP_SELF'];
  $sDirectoryFromRoot = "\\";
  $sDocumentRoot = $_SERVER['DOCUMENT_ROOT'] . $sDirectoryFromRoot;

  require_once($sDocumentRoot . "includes\\incl_connect_mysql.php");
  require_once($sDocumentRoot . "includes\\maintekst.php");
  session_start();

  $cDBConnection = fnCreateDatabaseConnectie();

  $arWaardes  = fnInloggen($sPagina, $cDBConnection);
  $sMainTekst     = $arWaardes[0];
  $iTypeId        = $arWaardes[1];
  $iAantalRegels  = $arWaardes[2];
  $sTypeTekst     = $arWaardes[3];
  include($sDocumentRoot . "templates/template.html");

  function fnInloggen($sPagina, $oDBCon) {
    $arReturn = Array(); 
    $arReturn[0] = "";
    $arReturn[1] = 2;
    $arReturn[2] = 23;
    $arReturn[3] = "";
    $sTekst  = "<div id=\"tekst_venster\">\n";
    $sTekst .= "&nbsp;<br />\n";
    $sTekst .= "<div class=\"header_tekst tekst_rood\">Inloggen</div>\n";
    $sEmailAdres = $oDBCon->real_escape_string($_POST['email']);
    $sWachtwoord = $oDBCon->real_escape_string($_POST['wachtwoord']);
    $sSQL  = " SELECT ";
    $sSQL .= "   lid_id, ";
    $sSQL .= "   lid_voornaam, ";
    $sSQL .= "   lid_tussenvoegsel, ";
    $sSQL .= "   lid_achternaam  ";
    $sSQL .= " FROM tbl_leden ";
    $sSQL .= " WHERE lid_email = '" . $sEmailAdres . "' ";
    $sSQL .= "   AND lid_wachtwoord = '" . $sWachtwoord . "' ";
    $sSQL .= " LIMIT 1;";
    $rsLid = $oDBCon->query($sSQL);
    if($rsLid && $arLid = $rsLid->fetch_array()) {
      $iLidId = $arLid['lid_id'];
      $sNaam  = $arLid['lid_voornaam'];
      if(strlen($arLid['lid_tussenvoegsel']) > 0) {
        $sNaam .= " " . $arLid['lid_tussenvoegsel'];
      }
      $sNaam .= " " . $arLid['lid_achternaam'];
      $sTekst .= "Welkom " . $sNaam . "<br />\n";
      $sTekst .= "U bent ingelogd.<br />\n";
      $_SESSION['iLidId'] = $iLidId;
      $arReturn[1] = 11;
      $arReturn[3] = "<a href=\"/mangsys/toon_paginas.php\">Paginas wijzigen</a>";
    } else {
      $_SESSION['iInlogFouten']++;
      $sTekst .= "Uw gebruikersnaam en of wachtwoord kloppen niet<br />\n";
      $sTekst .= "<a href=\"/mangsys/login.php\">Klik hier</a> ";
      $sTekst .= "om opnieuw in te loggen.\n";
    }
    $sTekst .= "</div>\n";
    $arReturn[0] = $sTekst;
    return $arReturn;
  }
?>