shrek1609 Posted June 21, 2008 Share Posted June 21, 2008 I'm Still a noob so please be kind with the feedback... I have fully tested this and works well..... This is basically a drug stock market, members can buy upto 1000 drugs and at day update the prices will fluctuate between a high price and a low price randomly... Screen Shots: *** Important follow the instructions to install carefully... *** Create a file called drugbuy.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Create a file called druginv.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Create a file called drugmarket.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Create a file called drugsell.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote Link to comment Share on other sites More sharing options...
shrek1609 Posted June 21, 2008 Author Share Posted June 21, 2008 Re: The Drug Deal --- Free V2 Mod Either create a new file called cron_drug.php or add the following to your cron_day.php If adding to existing cron_day.php only add the code below where i have commented... You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. create a file called runonce.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Ok now you have created all these files upload them to your server... Import the following mysql... You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. THE IMPORTANT PART... *** AFTER DOING THE FOLLOWING EDIT YOU MUST QUICKLY RUN THE FILE runonce.php *** open register.php and FIND You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. ADD BELOW You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. NOW QUICKLY RUN... www.yourgamename.com/runonce.php And thats if folks you are all done... Remember if you created the new cron_drug.php to add that to your cron jobs and remember to add your cron code at the end of the url... Quote Link to comment Share on other sites More sharing options...
shrek1609 Posted June 21, 2008 Author Share Posted June 21, 2008 Re: The Drug Deal --- Free V2 Mod forgot to say remember to add links to drugmarket.php and druginv.php whereever you want them :D Quote Link to comment Share on other sites More sharing options...
shrek1609 Posted June 21, 2008 Author Share Posted June 21, 2008 Re: The Drug Deal --- Free V2 Mod How is it complicated??? 5 files to upload 1 sql file to import one edit followed by running a file once??? Quote Link to comment Share on other sites More sharing options...
topmorpg Posted June 21, 2008 Share Posted June 21, 2008 Re: The Drug Deal --- Free V2 Mod You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. I would like to point out some security flaws here that you need to take into account. qty from above. maxlength 4 can be changed with browser plugins that will allow this to change to any max length you want. remote page execution. Saving the html upload on another server and post back variables to your page to execute. Have it generate some sort of key that is randomized and filtered to make sure it was submitted on site. (should be done on most forms in your site and others) make sure it is numeric is_numeric() int($var) anything but make sure it is hex codes and malicious input can cause this to be a bad thing for you down the road. Thanks, TJ Quote Link to comment Share on other sites More sharing options...
shrek1609 Posted June 21, 2008 Author Share Posted June 21, 2008 Re: The Drug Deal --- Free V2 Mod with thanks to topmorpg i have just modified the drugsell.php and drugbuy.php to fix the security problem... So if you have already installed please replace the drugsell.php and drugbuy.php code with the modified version in first post... Thanks for your advice topmorpg :) Quote Link to comment Share on other sites More sharing options...
hobbes Posted September 11, 2008 Share Posted September 11, 2008 Re: The Drug Deal --- Free V2 Mod great job shrek, something else i wanted to point out from one of my beta testers is this bug. "I found the bug when you sell drugs. I was copying the amount and pasting it. This made the number that I copied include a space in the end. So if you try and type in the number of drugs you would like to sell and then have a space in the end you end up with selling the drugs but you get $0." anyone have a solution for this one? Quote Link to comment Share on other sites More sharing options...
Guest Anonymous Posted September 11, 2008 Share Posted September 11, 2008 Re: The Drug Deal --- Free V2 Mod trim() --- Strip whitespace (or other characters) from the beginning and end of a string. Quote Link to comment Share on other sites More sharing options...
Uridium Posted September 11, 2008 Share Posted September 11, 2008 Re: The Drug Deal --- Free V2 Mod you mentioned above about adding to cron day wouldnt it be easier to leave this file as it is and call it drg_cron.php and add a new cron job for it for an day You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote Link to comment Share on other sites More sharing options...
hobbes Posted September 11, 2008 Share Posted September 11, 2008 Re: The Drug Deal --- Free V2 Mod thx nyna, you rock! Quote Link to comment Share on other sites More sharing options...
Guest Anonymous Posted September 11, 2008 Share Posted September 11, 2008 Re: The Drug Deal --- Free V2 Mod Welcome. Ideally you should always trim of unwanted characters from POSTS *AND* GETS -- You can never guarantee that they user will type in exactly what you required. Quote Link to comment Share on other sites More sharing options...
Zero-Affect Posted September 12, 2008 Share Posted September 12, 2008 Re: The Drug Deal --- Free V2 Mod Very good point Nyna 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.