neo Posted March 23, 2004 Report Share Posted March 23, 2004 Tabulaa ir triis ieraksti. Uz ekraana tiek izvadiiti attieciigi triis checkbox ar savu id veertiibu. Probleema: forma nosuuta tikai vienu mainiigo, kaut arii ir ieklikskinaats visos checkbox. <? //fails tests.php include("db.php"); $result=mysql_query ("SELECT * FROM gallery ORDER BY id desc "); echo"<form name=form method=post action=tests.php>"; while($row = mysql_fetch_array($result)){ echo"<input name=mainigais type=checkbox value=$row[id]>"; } echo" <input type=submit name=submit value=Submit> </form> "; if(isset($submit)){ echo $mainigais; } ?> Link to comment Share on other sites More sharing options...
bubu Posted March 23, 2004 Report Share Posted March 23, 2004 korektaak butu: echo"<form name=\"form\" method=\"post\" action=\"tests.php\">"; un pie tam, ja jau visiem input tagiem name ir mainigais, tad logjiski, ka arii tu dabuusi tikai vienu $mainigais! Tak katram tagadm citu nami liec! Link to comment Share on other sites More sharing options...
bubu Posted March 23, 2004 Report Share Posted March 23, 2004 jaa un sheit arii: echo" <input type=\"submit\" name=\"submit\" value=\"Submit\"> </form> "; Link to comment Share on other sites More sharing options...
Aleksejs Posted March 23, 2004 Report Share Posted March 23, 2004 (edited) pieliec tukšas kvadrātiekavas checkbokša nosaukumam - tad visi ieķeksētie nosūtīsies kā masīvs. echo '<input name="mainigais[]" type="checkbox" value="' . $row[id] . '">" Edited March 23, 2004 by Aleksejs Link to comment Share on other sites More sharing options...
Recommended Posts