Jump to content

benanamen

Members
  • Posts

    2,134
  • Joined

  • Last visited

  • Days Won

    42

Everything posted by benanamen

  1. 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.
  2. 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
  3. 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 }
  4. 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
  5. 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.
  6. @Clipboardcode, You need to stop promoting your EXTREMELY dangerous app on this forum.
  7. @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.
  8. Yeah, no. NEVER EVER put variables in a query. ALWAYS use prepared statements.
  9. In payments you could add a "type" column. Types could be rent, late fee, pet deposit, repair reimbursement etc. They are all payments. You would need a types table and use the unique key to reference it in your payments table. It would help you a lot to look at some of the property management software that is out there. I haven't tried it but here is a free one. https://www.tenantcloud.com/ * Edit. I just checked it out. I am pretty impressed with what they have done.
  10. I just discovered that Windows <= V.7 has a hidden tool to record the steps to recreate a problem. It creates screenshots and a step by step text of actions taken and then zips it up. To access, just search for PSR (Problem Step Recorder) in the start menu search box. I can't believe I never knew about this. Thanks for hiding it stupid Microsoft.
  11. Interested in feedback regarding turning notices and warnings to exceptions with set_error_handler. To me, if you have warnings or notices the code is broke and needs to be fixed before it goes to production. If the app fatals you know it and HAVE to fix it. Pros? Cons? Manual Reference http://php.net/class.errorexception
  12. It sounds a lot like you have a bad database design. Can you post your DB schema or p.m. it?
  13. Forget the author. Just do (True example. Yours is a false example) If true if($row->mysql_field){ //Do something } This example is also in the manual. Couldn't find the page at the moment. if false (Your example) if(!$row->mysql_field){ //Do something }
  14. I just learned Vagrant a few months back. It is actually very simple and is a great tool for it's purpose. The only thing with using the pre-built boxes is you really don't know for sure exactly how it was configured when it was made. The time it takes to download a box, you could just create your own. The pre-mades are good for a quick to get going solution or just trying different OS's. Like @Jaques1 said, just download and install exactly what you want. For additional flexibility you can turn that into a Vagrant box of your own. If you're going to be a developer you need to get on 64 bit. You can't run 64 bit software on 32 bit hardware. For those not familiar with Vagrant, it's worth a look. https://www.vagrantup.com/
  15. From what I have learned of it so far, it seems well suited for real time two way connections using web sockets, which from what I gather from @NotionCommotion's posts and PM's is what he is doing. A node description I read that seems to fit. Of course, I am just starting to learn it which is why a real project would be nice to work with.
  16. As I mentioned in a previous PM, I really think Node.js is a much better tool for what you're doing. (For as much I understand your project). PM me enough working details of what you're doing and I will see what I can do in Node. I know you are not at a place to learn a new "language" right now. It will give me a real example that will help my skills in Node and I will also be able to bumpstart you with learning Node if/when you ever get there.
  17. Why are you throwing Javascript in there? Your script will fail if the user turns it off. Use Php's header to do your redirect. Also, do not EVER put variables in your query. You need to use prepared statements. And stop outputting the DB errors to the user. That info is only good to a coder or a hacker. I would suggest you start using PDO. https://phpdelusions.net/pdo
  18. As in C or Perl, PHP requires instructions to be terminated with a semicolon at the end of each statement. The closing tag of a block of PHP code automatically implies a semicolon; you do not need to have a semicolon terminating the last line of a PHP block. The closing tag for the block will include the immediately trailing newline if one is present. The closing tag of a PHP block at the end of a file is optional, and in some cases omitting it is helpful when using include or require, so unwanted whitespace will not occur at the end of files, and you will still be able to add headers to the response later. It is also handy if you use output buffering, and would not like to see added unwanted whitespace at the end of the parts generated by the included files. http://php.net/manual/en/language.basic-syntax.instruction-separation.php The semi-colon at the start of the line is programmer preference. When there are many lines it is very easy to spot a missing one. Pick a style and stick to it. I only see it used for SQL statements.
  19. I explained the problem to you. Because you included thisfile.php in index, it is no different than if you moved thisfile.php out of the includes folder and placed it in the mninfo folder like so xampp/htdocs/mninfo/thisfile.php So the ../ in thisfile.php actually points to xampp/htdocs/ if you want to to point to the mninfo folder, remove one of the dots like so File thisfile.php: require './oldstuff.php';
  20. That is very much clearer and easily understandable. Unfortunately I am done for the night so I can't help you any further right now. I am sure someone will probably give you direction before I can get back to you. In the meantime, get familiar with the XY Problem in my signature. It will help you and us in the future.
  21. You don't need to use the full path. Start from the directory where you are at. I don't know exactly where the file oldstuff resides so I can't show you for sure. When you use ../ from an included file you are going above the main directory mninfo to look for it. I don't think that is where you have it. thisfile.php is effectively where index.php is because you included it to be there. It has "become one" with index.php so it it no different if you added ../oldstuff.php to the index file which in your case takes you to the htdocs folder looking for the file. index.php require './includes/js/common.js'; require './includes/thisfile.php'; require './oldstuff.php';// Assuming this file is in mninfo Also using the full path will not allow you to move your app around without editing the path every time.
  22. What you're doing wrong is not listening to what you were already told. @Barand showed you what to do.
  23. I for one dont understand what your doing. Forget your attempted solution for a minute. Try to describe better what you have and what it needs to do. This reads like you have all those records that will add a row, as in a single row. That doesn't make sense at the moment. Where is the hundred thousand records coming from? Best I can tell is you have three columns, an id, revenue, and date. If the dates have a zero value what date are you going to replace it with? Why do some have a zero for a date in the first place?
×
×
  • 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.