Autor Zpráva
Valocsay
Profil
<!doctype php>
<html>
<head>
<meta charset="utf-8">
<title>Dokument bez názvu</title>

</head>

<body>

<?php
       if($_POST["T1"]){
           $name = $_POST["Email"];
           $pass = $_POST["pass"];
           
               include "config.php";
               mysql_connect($MySQL_ip,$MySQL_user,$MySQL_pass);
               mysql_select_db($MySQL_name);
               $q = mysql_query("SELECT * FROM users WHERE Email='".$name."' AND Pass='".$pass."'");
                while($vystup = mysql_fetch_object($q)){
                    $id = $vystup->ID;
                    $Email = $vystup->Email;
                    $Pass = $vystup->Pass;
                    $poz = $vystup->pozicia;
                    $adm = $vystup->admin;
                    $p = $vystup->premium;
                    $meno = $vystup->First_name;
                    $priezvisko = $vystup->Last_name;
                    }
                    
            if($name == $Email AND $pass == $Pass){
                $_SESSION["ID"] = $id;
                $_SESSION["mail"] = $Email;
                if($poz == "1"){
                    $_SESSION["poz"] = "študent";
                    }
                if($poz == "2"){
                    $_SESSION["poz"] = "učiteľ";
                    }
                if($adm == "1"){
                    $_SESSION["adm"] = "uživateľ";
                    }
                if($adm == "2"){
                    $_SESSION["adm"] = "admin";
                    }    
                if($p == "1"){
                    $_SESSION["p"] = "";
                    }
                if($p == "2"){
                    $_SESSION["p"] = "Prémium";
                    }
                $_SESSION["meno"] = $meno;
                $_SESSION["priezvisko"] = $priezvisko;
                }
       }
         ?> 


<form class="form-grp clearfix grpelem" id="widgetu500" method="POST"><!-- none box -->
      <div class="fld-grp clearfix grpelem" id="widgetu511" data-required="true"  data-type="email"><!-- none box -->
       <label class="fld-label actAsDiv clearfix grpelem" id="u514-4" for="widgetu511_input"><!-- content --><span class="actAsPara">Prihlasovacie meno:</span></label>
       <span class="fld-input NoWrap actAsDiv clearfix grpelem" id="u512-4"><!-- content --><input class="wrapped-input" type="text" spellcheck="false" id="widgetu511_input" name="Email" tabindex="1"/><label class="wrapped-input fld-prompt" id="widgetu511_prompt" for="widgetu511_input"><span class="actAsPara">Zadajte meno</span></label></span>
      </div>
      <div class="fld-grp clearfix grpelem" id="widgetu501" data-required="false"><!-- none box -->
       <label class="fld-label actAsDiv clearfix grpelem" id="u503-4" for="widgetu501_input"><!-- content --><span class="actAsPara">Heslo</span></label>
       <span class="fld-input NoWrap actAsDiv clearfix grpelem" id="u504-4"><!-- content --><input class="wrapped-input" type="password" spellcheck="false" id="widgetu501_input" name="pass" tabindex="2"/></span>
       
      </div>
      
       <input class="submit-btn NoWrap grpelem" id="u510-17" type="submit" value="" name="T1"/>
</form>
       
      
      <!-- state-based BG images -->
</body>
</html>



Notice: Undefined index: T1 in C:\xampp\htdocs\loginform.php on line 12

Pomôžete mi prosím s týmto problémom? Snažím sa to vyriešiť už 3 dni, no nedarí sa mi to.
weroro
Profil
if(!empty($_POST["T1"])){
Valocsay
Profil
weroro:
if(!empty($_POST["T1"])){
po tejto úprave sa po stlačení tlačidla T1 nič nestane. Ako mám pokračovať aby login fungoval?
weroro
Profil
Aha, tak potom je potrebné použiť
if(isset($_POST["T1"])){
Keeehi
Profil
Valocsay:
Nebo na řádku 70 něco napsat do value.

Vaše odpověď

Mohlo by se hodit


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm:

0