Snukzz Posted December 9, 2004 Report Share Posted December 9, 2004 Ir kods kursh neiet: <?php include('config.php'); include($CONF['inc_A'].'connect.php'); ?> <TABLE cellpadding=0 cellspacing=0 align="CENTER" valign="CENTER" width="200" border="1" borderstyle="SOLID" bgcolor="#CCCCCC"> <FORM action=do_login.php method=post id=f> <TR><TD colspan=2 align="CENTER"><font face="ARIAL" size="2" color="#00099"><b> LOGIN TO ILB</b></font></TD></TR> <TR><TD><font face="ARIAL" size="1" color="#FF0000"><b>NAME:</b></font></TD><TD align="CENTER"><INPUT type=text name=name value="<?=$_SESSION['name'] ?>" id=n></TD></TR> <TR><TD><font face="ARIAL" size="1" color="#FF0000"><b>PASW:</b></font></TD><TD align="CENTER"><INPUT type=password name=psw value="<?=$_SESSION['passw'] ?>" id=p></TD></TR> <TR><TD> </TD><TD align="CENTER"><INPUT type=submit value="ENTER ILB"></TD></TR> </FORM> </TABLE> Esmu varbuut veel aizmidzis, bet nerubiiju, kur ir kljuuda. Piekonnektee visu OK, bet bljauj par nedefineetu "name" :ph34r: kaa vinsh ir jaadefinee? Kaa sesijas nosaukums, vai kaa...??? :blink: Link to comment Share on other sites More sharing options...
Venom Posted December 9, 2004 Report Share Posted December 9, 2004 pēc noklusējuma sessija ir tukšs masīvs, tāpēc, ja tu raksti uzreiz $_SESSION['name'] => name apakšelements nav definēts var rīkoties divejādi - iniciēt mainīgo ar noklusēto vērtību if (empty($_SESSION['name'])) (vai tikai !isst($_SESSION['name'])) $_SESSION['name']=''; pārbaudīt tieši pie izvada echo '<input name="x" value="'.(empty($_SESSION['name'])?'':$_SESSION['name']).'" />'; Link to comment Share on other sites More sharing options...
Snukzz Posted December 9, 2004 Author Report Share Posted December 9, 2004 Thanks.... paproveesim ! ;) Link to comment Share on other sites More sharing options...
Snukzz Posted December 9, 2004 Author Report Share Posted December 9, 2004 mmm...pirms formas izvadiishanas uzliku session_register('name').session_register('passw');{...} un viss aizgaaja... taa var buut??? Link to comment Share on other sites More sharing options...
bubu Posted December 9, 2004 Report Share Posted December 9, 2004 Tu zini, ko dara punkts? Link to comment Share on other sites More sharing options...
Snukzz Posted December 9, 2004 Author Report Share Posted December 9, 2004 vaita neapvieno? :o Link to comment Share on other sites More sharing options...
Snukzz Posted December 9, 2004 Author Report Share Posted December 9, 2004 ai... man karoch vaag ljoti elementaaru ielogoshanaas sisteemu ar sesiju paliidziibu! Varbuut kaads zin kur ir kaac piemeers??? B) Link to comment Share on other sites More sharing options...
Venom Posted December 9, 2004 Report Share Posted December 9, 2004 kriviski saka полный песец Link to comment Share on other sites More sharing options...
Snukzz Posted December 9, 2004 Author Report Share Posted December 9, 2004 :rolleyes: vaardu sakot rekur mans varianc: pas skripc kursh tipa ielogo <? error_reporting(E_ALL); include('config.php'); $error=0; if(!isset($_POST['name']) || $_POST['name']==''){ $error=1; $_SESSION['logerror'][]='ieraksti vārdu'; } if(!isset($_POST['passw']) || $_POST['passw'] || $_POST['passw']==''){ $error=1; $_SESSION['logerror'][]='ieraksti paroli'; } if($error!=1){ $res=mysql_query('SELECT id,name FROM users WHERE name=\''.user_texc($_POST['name'],$CONF['max_nik'],255,1,1).'\'))=\''.user_texc($_POST['psw'],33,255,1,1).'\''); if($row=mysql_fetch_row($res)){ $_SESSION['id']=$row[0]; $_SESSION['name']=$row[1]; }else{ $res=mysql_query('SELECT id,name FROM users WHERE name=\''.user_texc($_POST['name'],$CONF['max_nik'],255,1,1).'\' && psw=\''.user_texc($_POST['psw'],33,255,1,1).'\''); if($row=mysql_fetch_row($res)){ $_SESSION['id']=$row[0]; $_SESSION['name']=$row[1]; }else{ $_SESSION['logerror'][]='Nepareiza parole vai lietotāja vārds'; } } } if ($logerror=1){?> <TABLE align="center"> <TR><TD> </TD><TD><? if(isset($_SESSION['logerror'])){ ?><P class=logerror><? while(list($key,$val)=each($_SESSION['logerror'])){ ?><?=$key+1 ?>) <?=$val ?><BR><? } ?></P><? unset($_SESSION['logerror']); } ?></TD></TR> </TABLE> <?} else{ header("Location: $CONF[inc_A]logged.php");} ?> Link to comment Share on other sites More sharing options...
bubu Posted December 9, 2004 Report Share Posted December 9, 2004 vaita neapvieno? :o Apvieno jau apvieno stringus. Bet session_register() ir fja, kas atgriež boolean vērtību (manuāli neskatījies). Tad kāda jēga, pasaki man, tos apvienot? Link to comment Share on other sites More sharing options...
Snukzz Posted December 9, 2004 Author Report Share Posted December 9, 2004 ai...nu ...man kofeiina shodien pamaz...ja... ;) Nu es gribeju tip lai peec abiem regjistriem izpildaas formas izvade... bet nu lai paliek... Link to comment Share on other sites More sharing options...
Venom Posted December 9, 2004 Report Share Posted December 9, 2004 NB: session_register ir atavisms Link to comment Share on other sites More sharing options...
Snukzz Posted December 9, 2004 Author Report Share Posted December 9, 2004 NB: session_register ir atavisms kas? :huh: Link to comment Share on other sites More sharing options...
Snukzz Posted December 9, 2004 Author Report Share Posted December 9, 2004 KLAU!!! SHADI eroru neizmet tikai nepaarsuuta passw..:( <?php include('config.php'); include($CONF['inc_A'].'connect.php'); session_register('passw','name'); { ?> <TABLE cellpadding=0 cellspacing=0 align="CENTER" valign="CENTER" width="200" border="1" borderstyle="SOLID" bgcolor="#CCCCCC"> <FORM action=do_login.php method=post id=f> <TR><TD colspan=2 align="CENTER"><font face="ARIAL" size="2" color="#00099"><b> LOGIN TO ILB</b></font></TD></TR> <TR><TD><font face="ARIAL" size="1" color="#FF0000"><b>NAME:</b></font></TD><TD align="CENTER"><INPUT type=text name=name value="<?=$_SESSION['name'] ?>" id=n></TD></TR> <TR><TD><font face="ARIAL" size="1" color="#FF0000"><b>PASW:</b></font></TD><TD align="CENTER"><INPUT type=password name=psw value="<?=$_SESSION['passw'] ?>" id=p></TD></TR> <TR><TD> </TD><TD align="CENTER"><INPUT type=submit value="ENTER ILB"></TD></TR> </FORM> </TABLE> <?}?> Link to comment Share on other sites More sharing options...
bubu Posted December 9, 2004 Report Share Posted December 9, 2004 (edited) KLAU!!! SHADI eroru neizmet tikai nepaarsuuta passw..:( <?php ... session_register('passw','name'); ... <FORM action=do_login.php method=post id=f> ... Tev passw un name ir globāli mainīgie? Gadījumā pirms session_register nevajag: $passw = $_POST['psw']; $name = $_POST['name']; jo metode ta formai ir post, un diezvai tev ir automātiski globāļu piereģistrācija ieslēgta? Edited December 9, 2004 by bubu Link to comment Share on other sites More sharing options...
Recommended Posts