ziedinjsh Posted October 22, 2009 Report Share Posted October 22, 2009 (edited) Vēlos uztaisīt tādu lietu kā: Atverot lapu tur ir daudzas mazas bildes.. uzpiežot uz bildi atveras lietotāja profils ar viņa bildi.. Do you like this user? [Yes] [No] ///////////////: Yes ////// : No Divas pogas uzpiežot uz pogu Yes tad +1 pieskaita pie Yes bet ja no tad +1 pie no kkas līdzīgs kā poll`s tikai tas ir piesiastīts pie usera id tie slashi ir domāti kā poll bar nav ne jausmas kā to uztaisīt! Edited October 22, 2009 by ziedinjsh Quote Link to comment Share on other sites More sharing options...
Kavacky Posted October 22, 2009 Report Share Posted October 22, 2009 Jausma #1, jausma #2. Quote Link to comment Share on other sites More sharing options...
yeahz Posted October 22, 2009 Report Share Posted October 22, 2009 (edited) <?php if (isset($_POST['yes'])) { mysql_query("UPDATE users SET yes = yes +1 WHERE id=$id"); } elseif (isset($_POST['no'])) { mysql_query("UPDATE users SET no = no +1 WHERE id=$id"); } ?> <p>Patīk?</p> <form method="post"> <input type="submit" name="yes" value="yes" /> </form> <form method="post"> <input type="submit" name="no" value="no" /> </form> Edited October 22, 2009 by yeahz Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted October 22, 2009 Author Report Share Posted October 22, 2009 db uztaisīju yes un no INT(100) $id = $_POST['id'] uztaisīju šādu pirms koda, bet uzspiežot kādu no pogām, informācija neievadās! Quote Link to comment Share on other sites More sharing options...
yeahz Posted October 22, 2009 Report Share Posted October 22, 2009 INTam man liekas ka maksimālais ir 11 nevis 100. Un kāpēc tev ir POST[id]? Vai tad tu neizmanto kaut ko līdzīgu kā šis - adrese.lv/lietotajs.php?id=45 ? To varēja noprast pēc tā, ka tu jau atver lapu ar lietotāju. Ja tev ir tāda sistēma, tad lieto GET. 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.