morgan1122 Posted May 12, 2011 Share Posted May 12, 2011 Can Anyone Help??? Quote Link to comment Share on other sites More sharing options...
rulerofzu Posted May 13, 2011 Share Posted May 13, 2011 Attached is an updated fixed version of the stocks.php and staff_stocks.php Fixed security issue by removing PHP_SELF Cleaned up the code slightly and changed to use the $db class as that is what the class is there for. No point in having the class if you aint gonna use it. I tested this as far as adding stock and it being displayed and buy/selling etc. Didnt add the cron information but I did check over that code and it looks reasonable. stocks.zip Quote Link to comment Share on other sites More sharing options...
Dominion Posted May 13, 2011 Share Posted May 13, 2011 Only thing i would say is there is no point in having – You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. In staff stocks.php. The class does the “or die(mysql_error()) for you (unless its changed?). In any case thanks for taking the time to repost, and even update it. Quote Link to comment Share on other sites More sharing options...
rulerofzu Posted May 13, 2011 Share Posted May 13, 2011 I didnt take that much notice Dom. For any mysql_query , num_rows, fetch_assoc I did a find and replace to turn them into $db-> Wasnt going to put a lot of time into it just got it working and then noticed the PHP_SELF so removed those. But yes you are correct there is no need for or die(mysql_error()); Quote Link to comment Share on other sites More sharing options...
ChrisRowe Posted July 29, 2011 Share Posted July 29, 2011 Attached is an updated fixed version of the stocks.php and staff_stocks.php Fixed security issue by removing PHP_SELF Cleaned up the code slightly and changed to use the $db class as that is what the class is there for. No point in having the class if you aint gonna use it. I tested this as far as adding stock and it being displayed and buy/selling etc. Didnt add the cron information but I did check over that code and it looks reasonable. Just to let you know, your missing a ; on the end of line 114 Quote Link to comment Share on other sites More sharing options...
Danny696 Posted July 29, 2011 Share Posted July 29, 2011 (edited) This was like two months ago, and the post is like two years old. Please dont post Edited August 7, 2011 by Danny696 Quote Link to comment Share on other sites More sharing options...
wolfe Posted August 6, 2011 Share Posted August 6, 2011 Still with the attitude Danny. Tsk. Quote Link to comment Share on other sites More sharing options...
Nickson Posted August 7, 2011 Share Posted August 7, 2011 If it's an informative post with some useful content, then there is nothing wrong with it. If it's just a bump/spam, well that might be a bit annoying though.. Quote Link to comment Share on other sites More sharing options...
S.Cosmin Posted August 25, 2011 Share Posted August 25, 2011 After i installed the mod, i got a error. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. On line 109 is just this. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. How can i fix that guys? Please... Quote Link to comment Share on other sites More sharing options...
sniko Posted August 25, 2011 Share Posted August 25, 2011 After i installed the mod, i got a error. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. On line 109 is just this. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. How can i fix that guys? Please... You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Try that Quote Link to comment Share on other sites More sharing options...
morgan1122 Posted September 10, 2011 Share Posted September 10, 2011 sorry i got an error im rubbish at coding so sorry if its just basic Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/morgan95/public_html/stocks.php on line 109 Quote Link to comment Share on other sites More sharing options...
Lithium Posted September 10, 2011 Share Posted September 10, 2011 sorry i got an error im rubbish at coding so sorry if its just basic Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/morgan95/public_html/stocks.php on line 109 If you have read the damn thread the answer would be right in front of your eyes! Quote Link to comment Share on other sites More sharing options...
morgan1122 Posted September 10, 2011 Share Posted September 10, 2011 If you have read the damn thread the answer would be right in front of your eyes! I tryed that :/ Quote Link to comment Share on other sites More sharing options...
Dominion Posted September 10, 2011 Share Posted September 10, 2011 I tryed that :/ Are you using rulerofzu's (http://makewebgames.io/showthread.php/33419-mccode-v2-Stock-Market.-Working-Secured?p=254669&viewfull=1#post254669) or the one from the original post? Posting a few lines may help? Quote Link to comment Share on other sites More sharing options...
morgan1122 Posted September 10, 2011 Share Posted September 10, 2011 Are you using rulerofzu's (http://makewebgames.io/showthread.php/33419-mccode-v2-Stock-Market.-Working-Secured?p=254669&viewfull=1#post254669) or the one from the original post? Posting a few lines may help? yes dom :( Quote Link to comment Share on other sites More sharing options...
Dominion Posted September 10, 2011 Share Posted September 10, 2011 yes dom :( That does not answer the question... Are you using the original or updated one. O.o Quote Link to comment Share on other sites More sharing options...
morgan1122 Posted September 10, 2011 Share Posted September 10, 2011 (edited) oh sorry the updated one now the error is Parse error: syntax error, unexpected '}' in /home/morgan95/public_html/stocks.php on line 115 echo 'You do not have enough money for this amount of stocks.'; return; } 111 $stock_holds = $db->query("SELECT holdingID FROM `stock_holdings` WHERE `holdingUSER` = ".$ir['userid']." AND `holdingSTOCK` = ".$stock['stockID']); 112 if($db->num_rows($stock_holds)) { 113 $db->query("UPDATE `stock_holdings` SET `holdingQTY` = (`holdingQTY` + ".$amnt.") WHERE `holdingUSER` = ".$ir['userid']." AND `holdingSTOCK` = 114".$stock['stockID']) 115 } 116 else { $db->query("INSERT INTO `stock_holdings` (`holdingUSER`,`holdingSTOCK`,`holdingQTY`) VALUES (".$ir['userid'].",".$stock['stockID'].",".$amnt.")"); } Edited September 10, 2011 by morgan1122 Quote Link to comment Share on other sites More sharing options...
Dominion Posted September 10, 2011 Share Posted September 10, 2011 http://makewebgames.io/showthread.php/33419-mccode-v2-Stock-Market.-Working-Secured?p=259694&viewfull=1#post259694 ^ answer for you. ;) Quote Link to comment Share on other sites More sharing options...
morgan1122 Posted September 10, 2011 Share Posted September 10, 2011 (edited) Thanks dom its loading now but a bit of an error to my template on on that page it dont show the template heres the script You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Edited September 11, 2011 by morgan1122 Quote Link to comment Share on other sites More sharing options...
Danny696 Posted September 11, 2011 Share Posted September 11, 2011 Please use [c0de] and [/c0de] tags, the 0 should be an o Quote Link to comment Share on other sites More sharing options...
morgan1122 Posted September 11, 2011 Share Posted September 11, 2011 Done now danny :) Quote Link to comment Share on other sites More sharing options...
oxidati0n Posted September 25, 2011 Share Posted September 25, 2011 Used this modification as a base in my game (but recoded to work with my entire codebase), and it was prepared nicely. Thank you for sharing. Quote Link to comment Share on other sites More sharing options...
dnenb Posted November 16, 2013 Share Posted November 16, 2013 Loving this. Thanks man! 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.