skrach Posted July 4, 2009 Report Share Posted July 4, 2009 (edited) Sveicināti! Kāds varētu lūdzu palīdzēt, man radās tāda problēma! Spiežot uz lapas skaitās nost nauda - 5 crediti , bet es vēlētos lai skaitītos tikai tad kas nospiežu piemēram uz skinu vai kādu citu lietu! skin.php $query = mysql_query("SELECT credits FROM users WHERE user_id='".$user->user_info[user_id]."'"); $user = new user(Array($user->user_info[user_id])); $credits = mysql_result($query,0); $credits = $credits - 5; $database->database_query("UPDATE users SET credits = '$credits' WHERE user_id='".$user->user_info[user_id]."'"); vajadzētu lai nospiežot pogu Jā (value='Jā') noskaitītos nauda, bet ja pogu Nē (value='Nē'), tad credit sum paliktu tada pati! Ka to varētu panākt? Kods iekšh mana tpl faila: skin.tpl <table cellpadding='0' cellspacing='0' width='100%'> <h2 style="float: center;">Izvēlies sev piemērotu skinu!</h2> <br> <p style="float: left;"> <input style="padding: 3px;" type="image" name="grootte" value="1" src="skin/img/1.jpg" onclick="SetCookie(nameOfCookie, this.value, exp); confirmPrice();"> <input style="padding: 3px;" type="image" name="grootte" value="2" src="skin/img/2.jpg" onclick="SetCookie(nameOfCookie, this.value, exp); confirmPrice();"> <input style="padding: 3px;" type="image" name="grootte" value="3" src="skin/img/3.jpg" onclick="SetCookie(nameOfCookie, this.value, exp); confirmPrice();"> </p> {literal} <script type="text/javascript"> <!-- function confirmPrice() { TB_show('{/literal}{lang_print id=759}{literal}', '#TB_inline?height=100&width=300&inlineId=confirmPrice', '', '../images/trans.gif'); } //--> </script> {/literal} {* HIDDEN DIV TO DISPLAY CONFIRMATION MESSAGE *} <div style='display: none;' id='confirmPrice'> <div style='margin-top: 10px;'> Tiešām vēlaties pirkt šo pakalpojumu? </div> <br> <input type='button' class='button' value='Jā' onClick='doRefresh();'> <input type='button' class='button' value='Nē' onClick='doRefresh();'> </div> </table> Edited July 5, 2009 by skrach Quote Link to comment Share on other sites More sharing options...
Kemito Posted July 5, 2009 Report Share Posted July 5, 2009 class liec nevis button bet gan labāk submit! Uztaisi ar IF(ISSET($_POST['ja'])) notiek tas un tas IF(ISSET($_POST['ne'])) nenotiek nekas vai aiziet uz linku! :) Quote Link to comment Share on other sites More sharing options...
skrach Posted July 5, 2009 Author Report Share Posted July 5, 2009 (edited) class liec nevis button bet gan labāk submit! Uztaisi ar IF(ISSET($_POST['ja'])) notiek tas un tas IF(ISSET($_POST['ne'])) nenotiek nekas vai aiziet uz linku! :) varētu lūdzu apmēram uzrakstīt kā tas kods izskatās? vnk es esmu iesācējs un ar $_POST vēl neesmu rīkojies Edited July 5, 2009 by skrach 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.