Jump to content

Recommended Posts

Hey everyone!

 

I have been working on a text based mafia game, and one of the pages is "Weed Farm".

In simple terms, Users can plant seeds and grow them. They can also upgrade there farm, the better the farm, the more they can grow.

Everything works perfect, other than when you plant the seeds, and wait 24 hours, when you go back to sell them, it says you have 0.

 

I guess for some of you guys it'll be simple code, but not for a Noob like me. Any help i will be thankful off. 

 

I have attached the necessary files, many thanks. 

weedfarm.php

func.php

Link to comment
https://forums.phpfreaks.com/topic/303248-help-please/
Share on other sites

before anyone bothers with the OP's code, be advised -

 

1) it totals ~ 500 lines of uncommitted code.

 

2) it uses the mysql_ extension.

 

3) there's no sql injection security.

 

4) there is some javascrpt in it that evaluates escaped strings to various <td ,,,,,> html values. hopefully the OP won't replace that with something else by the time his thread edit time expires or when he posts more code.

 

5) there are a bunch of verbose lower-case variable names, like $upgrademoneyorcredits and $newleveltime...

 

6) the func.php file contains several sections of in-line php code along with some function definitions, one of which could be replaced with a number_format() call.

 

7) the main file has post method form processing code interspersed with html.

 

in short, it's impossible to tell what the code is doing now, in order to determine why it isn't working.

 

to the OP, this code needs to be rewritten, reversing everything mentioned in my list.

  • Like 1
Link to comment
https://forums.phpfreaks.com/topic/303248-help-please/#findComment-1543112
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.