LCKB
Simple Cash Adder: Web-Page - Printable Version

+- LCKB (https://lckb.dev/forum)
+-- Forum: ** OLD LCKB DATABASE ** (https://lckb.dev/forum/forumdisplay.php?fid=109)
+--- Forum: Website Scripting & Security (https://lckb.dev/forum/forumdisplay.php?fid=197)
+---- Forum: Website Releases (https://lckb.dev/forum/forumdisplay.php?fid=135)
+----- Forum: Ep1 Websites (https://lckb.dev/forum/forumdisplay.php?fid=185)
+----- Thread: Simple Cash Adder: Web-Page (/showthread.php?tid=973)



- barroso - 07-21-2012



Simple Cash Adder: Web-Page

NOTE: Fill in the fields and click three times to ADD or CHANGE TO            ZERO!Then press F5.

<?php

//currently an example, change to your desired infomation
$dbuser = "root";
$dbpass = "";
$dbhost = "localhost";
$dbname = "newproject_db_auth";

//connect to database
$msconn = mysql_connect($dbhost, $dbuser, $dbpass);
$db = mysql_select_db($dbname, $msconn);
mysql_query("set names UTF8");

$cash = mysql_query("SELECT user_id, cash, email FROM bg_user WHERE cash <> 0 ");
echo "

User ID:
Cash
Email
".$row["user_id"]."
".$row["cash"]."
".$row["email"]."
";

$msconn = mysql_connect($dbhost, $dbuser, $dbpass);
$db = mysql_select_db($dbname, $msconn);
$amount = mysql_query("UPDATE bg_user SET cash = cash+(".$_POST[amount].") WHERE user_id = ".$_POST[userid]. " ");
echo
Add cash to anyone:;
echo ;
echo "";
echo
;

$msconn = mysql_connect($dbhost, $dbuser, $dbpass);
$db = mysql_select_db($dbname, $msconn);

$zero = mysql_query("UPDATE bg_user SET cash = 0 WHERE user_id = ".$_POST[zero]. " ");

echo CASH = 0:User ID:

?>