Jump to content
MakeWebGames

[mccode v2] The Drug Deal


shrek1609
 Share

Recommended Posts

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:

drugdeal.jpg

 

druginv.jpg

*** 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.

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

  • 2 months later...

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?

Link to comment
Share on other sites

Guest Anonymous

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...