jauninjais Posted March 15, 2006 Report Share Posted March 15, 2006 diezgan vienkaarshs kods, bet nevaru izdomaat kas jaadara. kaa var apsleept to logu, kur vajag ievadiit paroli peec pareizas paroles ievadiishanas? <? $password = "parole"; if ($action=="login"){ if ($pass==$password){ include '1.html';} else {echo "Nepareiza parole";}} ?> <html> <head> </head> <body> <table border=1 align=middle> <form method="post" action="?action=login"><td>Parole:</td><td><input type="password" name="pass"><input type="submit" value="Ieiet"></td></form></table> </body> </html> Link to comment Share on other sites More sharing options...
Kristabs Posted March 15, 2006 Report Share Posted March 15, 2006 (edited) shaadi??? <? $password = "parole"; if ($action=="login"){ if ($pass==$password){ $notShow = 1; include '1.html';} else {echo "Nepareiza parole";}} if(!isset($notShow)){ ?> <html> <head> </head> <body> <table border=1 align=middle> <form method="post" action="?action=login"><td>Parole:</td><td><input type="password" name="pass"><input type="submit" value="Ieiet"></td></form></table> </body> </html> <?php } ?> Edited March 15, 2006 by Kristabs Link to comment Share on other sites More sharing options...
jauninjais Posted March 15, 2006 Author Report Share Posted March 15, 2006 (edited) aa nu ja, par isset biju pavisam piemirsis, paldies!!! Edited March 15, 2006 by jauninjais Link to comment Share on other sites More sharing options...
jauninjais Posted March 15, 2006 Author Report Share Posted March 15, 2006 (edited) veel 1 jautaajums, kaa var atvieglinaat sho kodu, es domaaju tieshi to post metodi, es saprotu,ka stulbi uztaisiits, bet ... <form method="post" action="jauna_zinja.php"> <table align="middle" bordercolor="#800000" border="1"> <tr> <td><textarea name="zinja" onFocus="this.value=''" wrap="virtual" rows="10" cols="40">Pievienot jaunu ziņu</textarea></td></tr><tr align="center"><td> <input type="submit" name="submit" value="Ierakstīt"> </font></form> </td> </tr></table> <? $zinja=$_POST['zinja']; $konekcija=mysql_connect('127.0.0.1','useris','parole2') or die ("PHPMYADMINAM pieslēgties neizdevās"); mysql_select_db('dbaaze',$konekcija); $vaicajums=mysql_query("INSERT INTO `tabula`(`zinja`) VALUES ('$zinja')",$konekcija); $rezultats=mysql_query($vaicajums2,$konekcija); $rindas=mysql_num_rows($rezultats); mysql_close($konekcija); ?> </body> </html> veel probleema tajaa, ka vinsh izmet erroru Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /usr/home/ftp/jauna_zinja.php on line 25 un iespeejams, ka deelj taa, man saak pievienot ieraxtus nevis tabulas augshaa, bet beigaas Edited March 15, 2006 by jauninjais Link to comment Share on other sites More sharing options...
bubu Posted March 15, 2006 Report Share Posted March 15, 2006 Un kura ir 25 rindiņa? Jopcig.. apnicis jau zīlēt. Link to comment Share on other sites More sharing options...
jauninjais Posted March 15, 2006 Author Report Share Posted March 15, 2006 (edited) nu kas nesaprotams, te tachu tikai vienaa vietaa tas mysql_num_rows, shii rinda $rindas=mysql_num_rows($rezultats); mysql_close($konekcija); ?> </body> </html> Edited March 15, 2006 by jauninjais Link to comment Share on other sites More sharing options...
bubu Posted March 15, 2006 Report Share Posted March 15, 2006 Sorry, nepamanīju.. Kļūdas iemesls: $vaicajums ir sintaktiski nekorekts. un vienmēr pārbaudi mysql_query funkcijas atgriesto rezultātu!!! Ja tas ir false, tad izsauc mysql_error(). UZREIZ redzēsi, kas par kļudu Link to comment Share on other sites More sharing options...
jauninjais Posted March 15, 2006 Author Report Share Posted March 15, 2006 (edited) viss skaidrs, nezin kaapeec nepareizi es saraxtiiju iznjemshanu no datubaazes Edited March 15, 2006 by jauninjais Link to comment Share on other sites More sharing options...
Recommended Posts