quik Posted December 13, 2008 Report Share Posted December 13, 2008 (edited) HTML un Php form. piemērs ir šāds: myownphpnhtml.freehostia.com/question.php šeit ir kods, kuru izmantoju question.php failam <body bgcolor="#d0d0d0"> <form action="answer.php" method="get"> <p align="center"> <font size="6" face="Verdana" color="red"> <b> (90-12)x 2=? </b> </font> <br/> Atbilde: <input type="text" answer="$answer"> <input type="submit" value="Atbildet!"> </form> Un šeit kods, kuru izmantoju answer.php failam: <?php $_GET["$answer"]; if ( $answer == "156" ) { echo "PAREIZI!"; }else{ echo "NEPAREIZI!"; } ?> Es gribu izdarīt tā, lai ievadot pareizo atbildi rāda PAREIZI, un jebkādu citu NEPAREIZI. Nesapratu, kas par kļūdu! Edited December 13, 2008 by quik Link to comment Share on other sites More sharing options...
waplet Posted December 13, 2008 Report Share Posted December 13, 2008 kāpēc ir $answer nevis parasti answer? vieglāk nebūtu <?php if ( $_GET["answer"] == "156" ) { echo "PAREIZI!"; }else{ echo "NEPAREIZI!"; } ?> Link to comment Share on other sites More sharing options...
quik Posted December 13, 2008 Author Report Share Posted December 13, 2008 Paldies! Link to comment Share on other sites More sharing options...
Recommended Posts