Autor | Zpráva | ||
---|---|---|---|
Valocsay Profil |
#1 · Zasláno: 13. 12. 2016, 11:29:20
<!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 |
#2 · Zasláno: 13. 12. 2016, 11:30:39
if(!empty($_POST["T1"])){ |
||
Valocsay Profil |
#3 · Zasláno: 13. 12. 2016, 11:43:16
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 |
#4 · Zasláno: 13. 12. 2016, 11:59:50
Aha, tak potom je potrebné použiť
if(isset($_POST["T1"])){ |
||
Keeehi Profil |
#5 · Zasláno: 13. 12. 2016, 17:24:37
Valocsay:
Nebo na řádku 70 něco napsat do value. |
||
Časová prodleva: 8 let
|
0