Jump to content

benanamen

Members
  • Posts

    2,134
  • Joined

  • Last visited

  • Days Won

    42

Everything posted by benanamen

  1. If you dont know html and CSS, start here :https://www.codecademy.com/learn/web Then go here https://www.codecademy.com/learn/php When you get farther along study this: https://phpdelusions.net/pdo Install XAMPP to run, test and learn on your local computer https://www.apachefriends.org/index.html
  2. Why are you storing the time separately? Just use a datetime column.
  3. You are expecting a POST array so look for a POST array. Do not use REQUEST. That includes POST, GET and COOKIES. if (isset($_POST ["flavour]) )
  4. If you did what @Jaques1 said you wouldn't have answered what you did. Go learn Database Normalization, ...then come back if you have problems after updating your DB.
  5. Aside from what @Jaques1 said, when you start numbering things something1, something2 etc. you are doing something wrong.
  6. How about posting an sql dump of your DB so we can work with it.
  7. Just noticed that you are looking up ICD codes. That data is way to huge to select everything. You are going to have to do something like a chained select where you select a category and work your way down the dropdowns. @barand makes a good point about the DB structure. What does the current DB look like? One big spreadsheet type table or something else?
  8. For starters, you don't need two queries to do the same exact thing. Dont SELECT *. Name the columns specifically. You are also opening your form AFTER the first select. In the posted code you don't close the form and there is no submit button. And next time, use the code tags when you post code.
  9. This is just for learning OOP. It is not about the function itself really, but how to handle superglobals in a class. The issue actually came up in a login logging class that uses $_SERVER['REMOTE_ADDR'], another superglobal. Several code analyzers (scrutinizer, codacy, code climate ) pointed out a problem with using them in the class. * As far as what the function is for, it is used to display messages to the user after certain actions such as a db record added or deleted
  10. How would I to convert the following function to a class? What is the proper way to deal with GET and POST in a class since they are globals? My start class ShowActionMessage { } Function to convert function show_action_messages() { if (isset($_GET['insert'])) { $action = 'Added'; } if (isset($_GET['edit'])) { $action = 'Updated'; } if (isset($_GET['deleted'])) { $action = 'Deleted'; } if (isset($_GET['emailed'])) { $action = 'Emailed'; } if (isset($action)) { ?> <div class="row"> <div class="col-md-8 col-md-offset-2"> <div class="success">Record <?= $action ?></div> </div> </div> <?php } }
  11. Change if (isset($_POST['submit']=="Sign Up")) To if ($_SERVER['REQUEST_METHOD'] == 'POST') You are also trying to use variables in your form without checking if those variables exist.
  12. Not even going to try and decipher your code. If you're doing an INSERT you have no need to know what the last insert id is.
  13. @pieterjandc, we all know you don't know what your talking about. Just stop already. You're starting to look foolish.
  14. You already lose "best answer ever" by using $_SERVER['PHP_SELF'] which is vulnerable to an XSS attack.
  15. Oh no, no, no, your problem is the entire database structure. Seriously, stop what you are doing right now and go back to the drawing board and start working on a sensible DB Schema. We will be happy to help you get going. What you have is an XY problem to the extreme. Start with a project summary of what this application is and what it should do then create a requirements document and post it. Once we know what you want and need we can offer the correct direction.
  16. In a nutshell, development server you turn on all error reporting and display errors on the page. Production it is off and errors are logged.
  17. The SSH is for a remote connection. Your script will run on the server. No SSH needed.
  18. If you had gone the Vagrant route first you would have saved yourself a lot of time and trouble. Install Xammp locally for development. If you want to develop or test on the exact server setup that you use in production, use Vagrant with your virtual box. The particular OS doesn't make a lot of difference as far as a LAMP stack. Apache is Apache is Apache. Php is Php is Php. Mysql is Mysql, is Mysql. My personal Linux choice for production is Debian. Ubuntu and many others are derivatives based off Debian.
  19. I have not used anything else recently to be able to tell you another way. Looks like Flowplayer has changed their model since I used it last.
  20. You might be interested in Flowplayer or Jplayer https://flowplayer.org/ http://jplayer.org/
  21. You will get better answers if you post your current DB SQL Schema with a few rows of sample data. My auto mechanic does a much better job at diagnosing my problems when he has the car in front of him. I suspect you still have other problems that need to be addressed if you want to do this correctly.
  22. What have you done with the information you were given? Show the updated code. The fix can't be any simpler, delete a dash.
×
×
  • 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.