Jump to content

benanamen

Members
  • Posts

    2,134
  • Joined

  • Last visited

  • Days Won

    42

Everything posted by benanamen

  1. You need to create a unique constraint on whatever identifies the users. They should not be allowed to sign up more than once with the same parameters.
  2. I ran across the following example of a Factory Pattern. My question is, why would you have all this Factory code when you could just call one of the extended button classes that you need? <?php abstract class Button { protected $_html; public function getHtml() { return $this->_html; } } class ImageButton extends Button { protected $_html = "..."; //This should be whatever HTML you want for your image-based button } class InputButton extends Button { protected $_html = "..."; //This should be whatever HTML you want for your normal button (<input type="button"... />); } class FlashButton extends Button { protected $_html = "..."; //This should be whatever HTML you want for your flash-based button } class ButtonFactory { public static function createButton($type) { $baseClass = 'Button'; $targetClass = ucfirst($type).$baseClass; if (class_exists($targetClass) && is_subclass_of($targetClass, $baseClass)) { return new $targetClass; } else { throw new Exception("The button type '$type' is not recognized."); } } } $buttons = array('image','input','flash'); foreach($buttons as $b) { echo ButtonFactory::createButton($b)->getHtml(); }
  3. The fact that you have more than one table says you're wrong, but you know better right?
  4. You can start with a proper database design. There is no such thing as sub categories. They are ALL categories. Some are Parents, some are Children. Look this over. http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/
  5. The Bike Shed Problem http://it.toolbox.com/blogs/coneblog/about-project-management-the-bikeshed-problem-32923
  6. Suddenly? I have never asked for homework help and I don't violate any of the other rules. What are you trying to say?
  7. From the Forums Rules
  8. Post the relevant code. We are not going to download an unknown zip file.
  9. LOL! While I never did anything about it, in my early days missing numbers really bothered me. Notion, in a good way. We here need to gather to save you from yourself.
  10. @NotionCommotion, I think it's time for an intervention.
  11. I don't have time at the moment to get into the implementation. I am sure Barand will jump in before I can. As far as MyISAM, what is stopping you from using InnoDB?
  12. Without the exact detail on the public_id I cannot make any comments on that part. You are on the right track here. Is this the part you do not understand how to do? On a side note, MongoDB is very well suited to this type of data.
  13. Isn't this when you would use a destructor in the class?
  14. Why are you creating multiple tables? You should have ONE animals table linked to an animal_type_id in a animal type table. What is with the multiple keys?
  15. Your code is obsolete and vulnerable to exploits and has been completely removed from Php. You need to use PDO with prepared statements. https://phpdelusions.net/pdo
  16. Your approach is wrong in the first place. You never ever put variables in the query. You need to use prepared statements and PDO. https://phpdelusions.net/pdo Also, if you have 42 columns in a single table it is highly likely your DB design is wrong. A DB is not a spreadsheet. Look up and learn Database normalization.
  17. Is that the best you can do? What basics? What Month? What number? What Array?
  18. You mean something like this? https://css-tricks.com/examples/DynamicOrderForm/
  19. This is going to be a reeeelly long thread. OP, the problem is you don't know what you don't know. You know enough about using a saw to cut your fingers off and that makes you dangerous in the coding world. You are not going to have any luck trying to argue what you think you know with people that actually do know what they are talking about. If you just needed to get the job done, you could have saved the company and yourself even more time and money if you just used the free Mysql Workbench or Phpmyadmin. Aside from that, there are numerous other tools that do the same thing, free and paid. You are trying to re-invent the wheel instead of getting the job done. If you really want to be a programer, listen carefully to what we tell you and apply it and get used to harsh criticism. There is a whole lot you don't know.
  20. Wait, wait, I know. No need to use google to learn anything. rm means remove the -r and f are flags for rm the r means recursively the f means forcefully and the slash means start at the server root
  21. If you want to be a good coder, get rid of the "works perfectly fine" mentality and adopt a "Best Practices" mentality. Lots of things "work perfectly fine" but you should never do it for that reason. We are not talking about "trapping" anything. The proper form procedure is basically if ($_SERVER["REQUEST_METHOD"] == "POST") { // Check if expected variable has a value, then do something }
  22. I am a bit confused. Did you write this app? If so, you can do all you did but you don't know a basic thing as how to check if there is a variable or not? As far as the login security, your starting point is learning how to use password_hash and password_verify
  23. To start with, warning message or not, that code should not be so freely available as it is. It will get downloaded and find it's way around the Internet. Take it down and post relevant code in the forum for help. I can't stress it enough, the code is EXTREMELY DANGEROUS. The very first thing you need to fix is the if plaintext == plaintext log me in problem. While you're in the code, get rid of all the @error suppressors. Errors are your friend. They tell you something is wrong and needs to be fixed. Get rid of the variables for nothing, Put the Javascript and CSS in a separate files. Your app relies quite a bit on Javascript to work. If JS is turned off, the app is useless. Once you have a secure solution to the login we can go from there. No point getting into anything else until you do that. I will leave it to you to see what you come up with. Using SQlite might be a good option for you. FYI: Your server is vulnerable to a Clickjacking Attack and you are advertising to the world what server and version your running.
  24. @Clipboardcode, You need to stop promoting your EXTREMELY dangerous app on this forum.
  25. @ClipboardCode, I just checked out your Data Grab code. It is EXTREMELY dangerous. It would be wise to stop promoting it until you have it right. If you want to talk more about it and get help on it start another thread so we don't hijack this one.
×
×
  • 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.