Sephy Posted October 2, 2011 Report Share Posted October 2, 2011 (edited) Tātad man ir datubāze no kuras es ierakstus ņemšu pēc virsraksta: <?php echo "<select style='margin-left:370px;margin-top:-20px;' name='galerija'>"; for($i = 1; $i <= $total_results; $i++){//total_pages cik ierakstu datubaze $check = mysql_query("SELECT * FROM news WHERE newid = '$i'"); $infos = mysql_fetch_array( $check ); echo "<option value='$infos[newsname]'>"; echo $infos['newsname']; echo "</option>"; } echo "</select><br><br>"; $derp=$_REQUEST['galerija']; echo $derp; ?> Vērtības parādās normāli(izvēlē parādās visi virsraksti datubāzē ka paredzēts), bet ar $_REQUEST neizdodas nolasīt ieraksta vērtību ;(, kur varētu būt problēma? Ar statiskām izvēles vērtībām viss strādā. Edited October 2, 2011 by Sephy Quote Link to comment Share on other sites More sharing options...
andism88 Posted October 3, 2011 Report Share Posted October 3, 2011 acīmredzot $_REQUEST['galerija'] nemaz nav piešķirta vērtības... Kapēc... neredzu jau kodu kur tam būtu janotiek... p.s. kapēc tiek lietots $_REQUEST nevis $_POST, $_GET vai $_COOKIE?? Quote Link to comment Share on other sites More sharing options...
Sephy Posted October 3, 2011 Author Report Share Posted October 3, 2011 Nu labi, tad jautājums kā pēc jūsu domām lai tam pašam $derp piešķir selecta galerija vērtību? Quote Link to comment Share on other sites More sharing options...
briedis Posted October 3, 2011 Report Share Posted October 3, 2011 Kur ir forma, kas padod POST mainīgos? Quote Link to comment Share on other sites More sharing options...
Sephy Posted October 3, 2011 Author Report Share Posted October 3, 2011 Jā, paldies, to es tikko arī pats sapratu ka vajag padot formu lai izvilktu vērtību ;D Quote Link to comment Share on other sites More sharing options...
andism88 Posted October 3, 2011 Report Share Posted October 3, 2011 (edited) iztrūkst tāda lieta kā <form action="lapa.php" method="post vai get"> utt. lai tiktu pieskjirta vertiba Tavam mainigam.. jau paspējāt atrisināt.. Edited October 3, 2011 by andism88 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.