Kemito Posted June 18, 2009 Report Share Posted June 18, 2009 You now I AM BACK :D Kārtējais uz nerviem krītošais Kemito jautajums ;) Respektīvi pagrābu Owmena skriptu tieši attiecībā uz registrāciju un Login lai to izprast, bet nu pie lietas! Respektīvi man kad ielogojas aizmet uz ?page=login bet ja to es redirekteju uz zinas ko velos lai ielogojoties parāda viņš nospiežot sākums izmet šo man :/ Viss itkā viņs aiziet bet nospiežot pogu sākums jeb uz to pašu linku - ?page=zinas Error: Notice: Undefined index: niks in C:\AppServ\www\index.php on line 15 Notice: Undefined index: parole in C:\AppServ\www\index.php on line 16 KODS: <?phpsession_start(); error_reporting(E_ALL); include("include/config.php"); include("include/functions.php"); if(isset($_SESSION['id'])) { $id = $_SESSION['id']; $result = mysql_query("SELECT * FROM lietotaaji WHERE id=$id"); } if(isset($_GET['page']) and $_GET['page'] == "zinas") { $niks = quote_smart($_POST['niks']); $parole = quote_smart(md5($_POST['parole'])); $result = mysql_query("SELECT * FROM lietotaaji WHERE niks=$niks and parole=$parole"); $row = mysql_fetch_row($result); $id = $row[0]; if(mysql_num_rows($result) == 1) { mysql_query("UPDATE lietotaaji SET online='1' WHERE id=$id"); $_SESSION['id'] = $id; } else { $nav = "<font color=red><b>Ielogošanās kļūda - Mēģiniet vēlreiz!</b></font>"; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>CS 1.6 CUPscript - yourname.lv</title> <link href="stils.css" rel="stylesheet" type="text/css" /> </head> <body> <?php if(!isset($_SESSION['id'])) { ?> <div align="center" style="margin-top: 150px;"> <form method="post" action="index.php?page=zinas"> <?php if(isset($nav)) { echo $nav; } ?> <br /> <a href="index.php"><img src="bildes/logo.png" alt="Logotips" /></a> <table> <tr><td>Niks:</td><td><input type="text" name="niks" /></td></tr> <tr><td>Parole:</td><td><input type="password" name="parole" /></td></tr> <tr><td></td><td><input type="submit" value="Ielogogties" /></td></tr> <tr><td></td><td align="right"><a href="register.php">Reģistrēties</a></td></tr> </table> </form> </div> <p> <?php } if(isset($_SESSION['id'])) { ?> <br /> <a href="index.php"><img src="bildes/logo.png" alt="Logotips" /></a></p> <div id="savelk"> <div id="izveelne"> <ul> <li><a href="index.php?page=zinas">Sākums</a></li> <li><a href="index.php?page=online">On-Line</a></li> <li><a href="index.php?page=top10">Top10[WN]</a></li> </ul> </div> <?php $row = mysql_fetch_assoc($result); $result = mysql_query("SELECT * FROM lietotaaji WHERE id=$id"); $row = mysql_fetch_assoc($result); $img = getimagesize($row['avatar']); ?> <div id="logo"><br /> </div> <div id="saturs"> <?php if(isset($_GET['page'])) { switch($_GET['page']) { case 'profils': include("switch/profils.php"); break; case 'veestules': include("switch/veestules_inbox.php"); break; case 'online': include("switch/online.php"); break; case 'lietotaaji': include("switch/lietotaaji.php"); break; case 'admin': include("switch/admin.php"); break; case 'zinasp': include("switch/zinasp.php"); break; case 'zinas': include("switch/zinas.php"); break; case 'wnp': include("switch/wnp.php"); break; case 'top10': include("switch/top10.php"); break; } } else { echo '<center>Tavs komentārs - Šeit<br></center>'; } ?> </div> <div id="apaksha"> <div style="padding-top: 13px">Autortiesības © 2009 Kemito</div> </div> </div> <div id="saanalinks"> <?php echo "Sveiks, <b> {$row['niks']} </b>!<br />"; ?> <?php echo "WN: <b>[{$row['punkti']}]</b><br />"; ?> <a href="index.php?page=veestules">Vēstules</a><br> <a href="index.php?page=profils">Mans profils</a><br> <div class=iziet> <a href="index.php?page=logout">Iziet</a><br> </div> </div> <?php } ?> </body> </html> Iekopēju visus savu index.php cerams ka ŠEIT kāds varēs palīdzēt! Quote Link to comment Share on other sites More sharing options...
anonīms Posted June 18, 2009 Report Share Posted June 18, 2009 iespējams tādēļ, ka nav if($_POST),jo pēc tā tik vajag mest $ar = $_POST['ar'], jo citādi nav no kurienes viņam ņemt. Quote Link to comment Share on other sites More sharing options...
Kemito Posted June 18, 2009 Author Report Share Posted June 18, 2009 iespējams tādēļ, ka nav if($_POST),jo pēc tā tik vajag mest $ar = $_POST['ar'], jo citādi nav no kurienes viņam ņemt. Bet kapēc man viņš ar ?page=login strādā bet kad abās vietas nomainu "zinas" dara šādi! :/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.