Monkuar Posted May 7, 2009 Share Posted May 7, 2009 Ok on my Forum gold system.. I Grab the username.. so like USER: input username here Money: input money here Comment: comment goes here //------------------------------------------------------------- // Transfer money //-------------------------------------------------------------- if ($func=="transfer_money") { if ($code=="") { $templateform = loadtemplate("shop_transfer_money_1"); eval(template); $output = $templateform; print_and_exit(); } elseif ($code=="send") { global $HTTP_POST_VARS; if (!isset($HTTP_POST_VARS["money"]) OR !is_numeric($HTTP_POST_VARS["money"]) OR $HTTP_POST_VARS["money"]<=0) { shoperror("Sorry, you can't 0 {$ibforums->vars["shop_currencyname"]}, or a negative amount, nice try though!"); } if ($HTTP_POST_VARS["money"] > $ibforums->member["points"]) { shoperror("You do not have enough {$ibforums->vars["shop_currencyname"]} to send " . currencyformat($HTTP_POST_VARS["money"])); } $money = $HTTP_POST_VARS["money"]; if (!isset($HTTP_POST_VARS["username"])) { shoperror("You must enter a member to send {$ibforums->vars["shop_currencyname"]} to!"); } $username = addslashes($HTTP_POST_VARS["username"]); $DB->query("SELECT id FROM ibf_members WHERE name='". mysql_real_escape_string($username) ."' LIMIT 1"); if ($DB->get_num_rows()==0) { shoperror("Recipient does not exist, correct spelling?"); } if (isset($HTTP_POST_VARS["post"])) { $PM_MSG = htmlspecialchars($HTTP_POST_VARS["post"]); } $id = $DB->fetch_row(); $id = $id["id"]; $money_new = currencyformat($money); $timestamp = date("F j, Y, g:i a"); $month = date(F); $year = date(Y); $DB->query("UPDATE ibf_members SET points = points + ". mysql_real_escape_string($money) ." WHERE id='" . mysql_real_escape_string($id) . "' LIMIT 1"); $DB->query("UPDATE ibf_members SET points = points - ". mysql_real_escape_string($money) ." WHERE id=". mysql_real_escape_string($ibforums->member["id"]) ." LIMIT 1"); $DB->query("INSERT INTO `ibf_logs` (`sender_id` ,`receiver_id` ,`amount` ,`date_time` ,`message`,`month`,`year`) VALUES (' ". mysql_real_escape_string($ibforums->member["id"]) ."', '". mysql_real_escape_string($id) ."', '". mysql_real_escape_string($money_new) ."', '". mysql_real_escape_string($timestamp) ."', '". mysql_real_escape_string($PM_MSG) ."', '". mysql_real_escape_string($month) ."', '". mysql_real_escape_string($year) ."');"); shop_addlog(array("type" => "M", "targetmemberid" => $id, "actiontext" => "Transfered {$money} {$ibforums->vars["shop_currencyname"]}" )); $post = ""; if (isset($HTTP_POST_VARS["post"])) { $message = htmlspecialchars($HTTP_POST_VARS["post"]); } $recipient = $username; $sender = $ibforums->member["name"]; global $std; $timestamp = $std->get_date(time(), "LONG"); $servicebotname = $ibforums->vars["shop_botname"]; $currencyname = $ibforums->vars["shop_currencyname"]; $currency = currencyformat($money); $templateform = loadtemplate("transfer_money_pm"); eval(template); $pm = $templateform; unset($templateform); global $std; $pm = $std->clean_value($pm); send_pm(array("recipientid" => $id, "title" => "{$ibforums->member["name"]} has sent you Forum Gold!", "message" => $pm, "senderid" => $ibforums->member["id"])); redirect("{$currency} sent to {$recipient}", "act=shop"); exit; } else { shoperror("Contact your board administrator and ask to be banned... no messing with board input "); } } I want it to be like.. USER ID: input userID here Money: input money here Comment: comment goes here ~~~~ So then they put in the user ID OF THE USER Instead of the username!! Help! Thanks <3 This is the code taken out of the original to seem less complicated, sorry. // Transfer money //-------------------------------------------------------------- if ($func=="transfer_money") { if ($code=="") { $templateform = loadtemplate("shop_transfer_money_1"); eval(template); $output = $templateform; print_and_exit(); } elseif ($code=="send") { global $HTTP_POST_VARS; if (!isset($HTTP_POST_VARS["money"]) OR !is_numeric($HTTP_POST_VARS["money"]) OR $HTTP_POST_VARS["money"]<=0) { shoperror("Sorry, you can't 0 {$ibforums->vars["shop_currencyname"]}, or a negative amount, nice try though!"); } if ($HTTP_POST_VARS["money"] > $ibforums->member["points"]) { shoperror("You do not have enough {$ibforums->vars["shop_currencyname"]} to send " . currencyformat($HTTP_POST_VARS["money"])); } $money = $HTTP_POST_VARS["money"]; if (!isset($HTTP_POST_VARS["username"])) { shoperror("You must enter a member to send {$ibforums->vars["shop_currencyname"]} to!"); } $username = addslashes($HTTP_POST_VARS["username"]); $DB->query("SELECT id FROM ibf_members WHERE name='". mysql_real_escape_string($username) ."' LIMIT 1"); if ($DB->get_num_rows()==0) { shoperror("Recipient does not exist, correct spelling?"); } if (isset($HTTP_POST_VARS["post"])) { $PM_MSG = htmlspecialchars($HTTP_POST_VARS["post"]); } Quote Link to comment https://forums.phpfreaks.com/topic/157232-i-need-to-pull-user-id-instead-of-username/ Share on other sites More sharing options...
Ken2k7 Posted May 7, 2009 Share Posted May 7, 2009 Wow, when's the last time someone used $HTTP_POST_VARS? I'm guessing you just change username to id or however you spelled it? Quote Link to comment https://forums.phpfreaks.com/topic/157232-i-need-to-pull-user-id-instead-of-username/#findComment-828469 Share on other sites More sharing options...
Monkuar Posted May 7, 2009 Author Share Posted May 7, 2009 This code was made by my friend in 2002 LOL It works fine but it easily hackable too I heard? We used escape strings to to try to clean it up but ya.. Sir please I really need your guys help.. ThankS! Quote Link to comment https://forums.phpfreaks.com/topic/157232-i-need-to-pull-user-id-instead-of-username/#findComment-828481 Share on other sites More sharing options...
Ken2k7 Posted May 7, 2009 Share Posted May 7, 2009 I guess you can try calling id with $HTTP_POST_VARS, but if that returns nothing, then you'll have to set it somewhere. Quote Link to comment https://forums.phpfreaks.com/topic/157232-i-need-to-pull-user-id-instead-of-username/#findComment-828482 Share on other sites More sharing options...
Monkuar Posted May 7, 2009 Author Share Posted May 7, 2009 Sir sorry, But i need you to spit the code back out for me so i can easily read it and copy it pasta back in if you dont mind, I know your mind is 100x smarter then monkuar's GOd please.. Thanks bro!! Bring your friends to this topic immediateness i need help i can get!! Thanks again! God blesS! Quote Link to comment https://forums.phpfreaks.com/topic/157232-i-need-to-pull-user-id-instead-of-username/#findComment-828485 Share on other sites More sharing options...
Ken2k7 Posted May 7, 2009 Share Posted May 7, 2009 First of all, I wouldn't know where to start in your code because I have no idea how it works. I'm just giving you suggestions. And all topics here are treated as equal and to the extent which people can offer help. The urgency of your situation will not get you more attention that the other topics so you can stop that. Quote Link to comment https://forums.phpfreaks.com/topic/157232-i-need-to-pull-user-id-instead-of-username/#findComment-828495 Share on other sites More sharing options...
Monkuar Posted May 7, 2009 Author Share Posted May 7, 2009 First of all, I wouldn't know where to start in your code because I have no idea how it works. I'm just giving you suggestions. And all topics here are treated as equal and to the extent which people can offer help. The urgency of your situation will not get you more attention that the other topics so you can stop that. I can actually do whatever I want to get your attention, Thanks tho brotha! Anyone else help me on this issue thx? Quote Link to comment https://forums.phpfreaks.com/topic/157232-i-need-to-pull-user-id-instead-of-username/#findComment-828988 Share on other sites More sharing options...
Ken2k7 Posted May 7, 2009 Share Posted May 7, 2009 I never said you can't. I just said it won't help you solve your issue. Quote Link to comment https://forums.phpfreaks.com/topic/157232-i-need-to-pull-user-id-instead-of-username/#findComment-828990 Share on other sites More sharing options...
Monkuar Posted May 7, 2009 Author Share Posted May 7, 2009 I never said you can't. I just said it won't help you solve your issue. Yes it will it will make people seem more motivated. dont tell me on how to live my life on the internet.. Quote Link to comment https://forums.phpfreaks.com/topic/157232-i-need-to-pull-user-id-instead-of-username/#findComment-828992 Share on other sites More sharing options...
premiso Posted May 7, 2009 Share Posted May 7, 2009 I can actually do whatever I want to get your attention, Thanks tho brotha! Seriously, all caps in titles are freaking annoying as all hell. And it is against the rules/terms of service you did agree to when registering/logging in: #2 under the Forum Guidelines 2. Users will not mark their post as being "URGENT" by either making the post ALL CAPS or adding any hint that they need it done Quick or ASAP. All posts are treated equal, your post is no more important than any other user's post on this forum. If it is "URGENT" pay someone to do it. So please, do not do it as you are saying your matter is more important than someone else's. If it is that urgent post in the freelance section and pay someone to do it. Honestly, I ignore all posts that have caps in the title due to the disrespect it gives other users who obey the rules. Following the guidelines will help your topic get answered faster than not following them. And being an asshole certainly will not motivate anyone to help you out. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/157232-i-need-to-pull-user-id-instead-of-username/#findComment-828993 Share on other sites More sharing options...
Monkuar Posted May 7, 2009 Author Share Posted May 7, 2009 I can actually do whatever I want to get your attention, Thanks tho brotha! Seriously, all caps in titles are freaking annoying as all hell. And it is against the rules/terms of service you did agree to when registering/logging in: #2 under the Forum Guidelines 2. Users will not mark their post as being "URGENT" by either making the post ALL CAPS or adding any hint that they need it done Quick or ASAP. All posts are treated equal, your post is no more important than any other user's post on this forum. If it is "URGENT" pay someone to do it. So please, do not do it as you are saying your matter is more important than someone else's. If it is that urgent post in the freelance section and pay someone to do it. Honestly, I ignore all posts that have caps in the title due to the disrespect it gives other users who obey the rules. Following the guidelines will help your topic get answered faster than not following them. And being an asshole certainly will not motivate anyone to help you out. Thanks. didnt even read it, lol Quote Link to comment https://forums.phpfreaks.com/topic/157232-i-need-to-pull-user-id-instead-of-username/#findComment-828995 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.