Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
[HELP] Vip_points transfer system :)
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Vaulient1" data-source="post: 172904" data-attributes="member: 26982"><p>[code]</p><p>[LIST=1]</p><p>[*][COLOR=#000000]<?php[/COLOR]</p><p>[*][COLOR=#000000] if(isset($_POST['send'])){ // If the form has been submitted.[/COLOR]</p><p>[*][COLOR=#000000] [/COLOR]</p><p>[*][COLOR=#000000] $to = $_POST['to'];[/COLOR]</p><p>[*][COLOR=#000000] $from = $_POST['from'];[/COLOR]</p><p>[*][COLOR=#000000] $amount = $_POST['amount'];[/COLOR]</p><p>[*][COLOR=#000000] [/COLOR]</p><p>[*][COLOR=#000000] $from_sql = "UPDATE users SET vip_points = vip_points - $amount WHERE username='$from'";[/COLOR]</p><p>[*][COLOR=#000000] mysql_query($from_sql);[/COLOR]</p><p>[*][COLOR=#000000] $to_sql = "UPDATE users SET vip_points = vip_points + $amount WHERE username='$to'";[/COLOR]</p><p>[*][COLOR=#000000] mysql_query($to_sql);[/COLOR]</p><p>[*][COLOR=#000000] }[/COLOR]</p><p>[*][COLOR=#000000] [/COLOR]</p><p>[*][COLOR=#000000]?>[/COLOR]</p><p>[*][COLOR=#000000]<form method="post" action="">[/COLOR]</p><p>[*][COLOR=#000000] <input name="from" type="hidden" value="{username}">[/COLOR]</p><p>[*][COLOR=#000000] Amount: <input name="amount" type="text"><br>[/COLOR]</p><p>[*][COLOR=#000000] To: <input name="to" type="text"><br>[/COLOR]</p><p>[*][COLOR=#000000] <input type="submit" name="send" value="Transfer" />[/COLOR]</p><p>[*][COLOR=#000000]</form>[/code][/COLOR]</p><p><span style="color: #000000"> Hey guys , thanks for reading my thread , I love you all ^-^ Well you see that php code works efficiently but one problem though , it lets us send how amny vip_points to another user and causing this <a href="http://prntscr.com/pmvn2" target="_blank">http://prntscr.com/pmvn2</a></span></p><p><span style="color: #000000"> you see? -50? Well could anybody of you guys help me to preevent it from deductiong more than 0? Make it to give a warning or a notification saying "you do not have enough shells". </span></p><p><span style="color: #000000"> I would be glad if you helped , thank you <img src="/styles/default/xenforo/smilies/emojione/smile.png" class="smilie" loading="lazy" alt=":)" title="Smile :)" data-shortname=":)" /></span></p><p>[/LIST]</p></blockquote><p></p>
[QUOTE="Vaulient1, post: 172904, member: 26982"] [code] [LIST=1] [*][COLOR=#000000]<?php[/COLOR] [*][COLOR=#000000] if(isset($_POST['send'])){ // If the form has been submitted.[/COLOR] [*][COLOR=#000000] [/COLOR] [*][COLOR=#000000] $to = $_POST['to'];[/COLOR] [*][COLOR=#000000] $from = $_POST['from'];[/COLOR] [*][COLOR=#000000] $amount = $_POST['amount'];[/COLOR] [*][COLOR=#000000] [/COLOR] [*][COLOR=#000000] $from_sql = "UPDATE users SET vip_points = vip_points - $amount WHERE username='$from'";[/COLOR] [*][COLOR=#000000] mysql_query($from_sql);[/COLOR] [*][COLOR=#000000] $to_sql = "UPDATE users SET vip_points = vip_points + $amount WHERE username='$to'";[/COLOR] [*][COLOR=#000000] mysql_query($to_sql);[/COLOR] [*][COLOR=#000000] }[/COLOR] [*][COLOR=#000000] [/COLOR] [*][COLOR=#000000]?>[/COLOR] [*][COLOR=#000000]<form method="post" action="">[/COLOR] [*][COLOR=#000000] <input name="from" type="hidden" value="{username}">[/COLOR] [*][COLOR=#000000] Amount: <input name="amount" type="text"><br>[/COLOR] [*][COLOR=#000000] To: <input name="to" type="text"><br>[/COLOR] [*][COLOR=#000000] <input type="submit" name="send" value="Transfer" />[/COLOR] [*][COLOR=#000000]</form>[/code][/COLOR] [COLOR=#000000] Hey guys , thanks for reading my thread , I love you all ^-^ Well you see that php code works efficiently but one problem though , it lets us send how amny vip_points to another user and causing this [url]http://prntscr.com/pmvn2[/url][/COLOR] [COLOR=#000000] you see? -50? Well could anybody of you guys help me to preevent it from deductiong more than 0? Make it to give a warning or a notification saying "you do not have enough shells". [/COLOR] [COLOR=#000000] I would be glad if you helped , thank you :)[/COLOR] [/LIST] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
[HELP] Vip_points transfer system :)
Top