Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/02/2019 in all areas

  1. Those undefined errors are because of sloppy coding. LOOK at your attempts to grab the input values. At least you are now making valid references to the html inputs but you are not using the correct array name, namely "$_POST". Programming is very much an EXACT science. So - $post and $_post are incorrect and you need to learn soon that you must be on the lookout for these kind of 'easy' errors. You should also be validating your inputs to make sure that you have the required values needed to create a new record. If the user doesn't give you something, send them an error message and make them re-submit the form. You can assign a variable to the input's value= attribute so that when you send back the form their input (that the DID provide) shows up the second time
    1 point
  2. you made all those changes but never re-posted the new code for us to debug
    1 point
  3. Benanamen had good coverage already. I'm repeating a few of his points I'm sure. For a first project, it is not bad. You are doing some good things including the use of prepared statements, although you neglected to use them for your insert. Be consistent! All SQL DML (insert, update, delete) should use prepared statements, and in most cases so should your select. Always treat user input as suspect. I posted in your other thread, so I'm repeating myself now---- Why are you using ob_start()? That is an advanced feature that is not warranted here, nor appropriate. Remove ob_start(). Use require_once() not include_once(). Look at what the functions do. Ask yourself this question: Does my script REQUIRE connection.php to work, or would it be ok if it wasn't loaded? It's pretty clear here that you need the script to be loaded for anything to work, so you should require it. I never use include_once, nor should you. Again repeating myself, remove the closing php tag from connection.php. Standard indentation would be 4 spaces. You are indenting like 8 spaces --- it's crazy ? The next thing I'd suggest would be to move all the markup into separate files that you include. This would start you towards templates/views. This is essentially the idea behind "separation of logic and presentation". Again for a first project, you are doing great. I've seen some "professional" projects where the code wasn't as good. Nice work, and continue to ask for clarifications when you aren't clear about the advice being given.
    1 point
  4. Do you not want to show us the updated code? And - are these error messages ACTUALLY EXACTLY what you are posting here? Seem very wrong. Do you have php error checking turned on?
    1 point
This leaderboard is set to New York/GMT-04:00
×
×
  • 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.