Jump to content

benanamen

Members
  • Posts

    2,134
  • Joined

  • Last visited

  • Days Won

    42

Posts posted by benanamen

  1. @Jaques1,

     

    I like what you did with the foreach for missing parameters. That saves a lot of repetitive error checks.

     

    In your example you go with if not errors continue/else show errors. Any reason not to do the opposite and go with if errors display them/else continue processing. Thinking in logical and positive order (if errors), if there are errors, it seems handling the errors would be step two and not step three. Does it even matter?

  2. I disagree.

     

    To be clear, you do agree $_SERVER['PHP_SELF'] is vulnerable to an XSS Attack right?

     

    not switching to some other parameter which you hope is safe.

     

    In your experience, have you ever known $_SERVER['SCRIPT_NAME'] to be unsafe in any cases, edge or otherwise?

     

    In this specific case

     

    That would seem key. What about in the case where an index.php includes all the pages from $_GET?

    i.e. index.php?p=contact (Code reference: https://forums.phpfreaks.com/topic/302370-router-any-issues-comments/)

     

    Would you advocate always hard coding the index.php name instead of the following:

    <form action="<?= $_SERVER['SCRIPT_NAME'] ?>?p=<?= $_GET['p'] ?>" method="post">

     

    As soon as you implement URL rewriting, physical names become meaningless and will likely break the frontend.

     

     You specifically mention the frontend. I pretty much only do backends with the previously noted code link so I don't do URL rewriting. Is there any case with the previous style AND Url rewriting that would be a problem?

  3. Why are you querying the users table twice. You are just overwriting the first query. You need to ORDER BY on the column you want sorted by. You don't need to manually close the DB connection. It will close automatically when the script finishes running.

     

    Also, select specific column names, not SELECT * and use the column name results, not row[0]. Who the heck is going to know what you're dealing with when reading the script?

  4. http://sims.net/ ????

     

    All that is there is a useless broken outdated site with next to no information or a contact number. Is this a third party company that you do business with or does it belong to you?

     

    If it's third party I would be highly sceptical of trusting my business to them based on what I see there.

     

    As long as we are at it, how about attaching a zip of those php files you listed. Some people on here don't like to download zips but I will sandbox it before I open it.

     

    How locked into this "System" are you? There are much better booking systems available.

     

    * Does this have anything to do with the SIM's reality simulator game?

  5. Ok, got it. Long day in front of the computer.

     

    Could you please attach the entire script. 

     

    Are these the certain events and is this the order of display?

     

    Tornado Warning, Severe Thunderstorm Warning, Flash Flood Warning, Flood Warning

  6. Are you really going to make us drag info out of you post by post? 

     

    WHAT MIS?

     

    IS THERE AN API?

     

    Getting this right starts with the datasource, not your attempt at how to handle it. See the XY Problem in my signature.

  7. What I'm referring to can be accomplished with plain HTML and PHP. Basically, a user is presented with a blank form. They fill it out and hit submit. Then PHP processes the submission. If it finds a required field that was left blank, PHP builds the form again and incorporates everything the visitor entered before, along with an error about the missing data

     

    All fine and good and as it should be. What I am saying and others would say, is use CSS for the layout you want, not HTML.

     

    i.e: <table><tr><td>.....

     

    There is nothing more I can say other than that.

  8. As previously asked, What MIS system and is their an API available? 

     

    Is that the complete DB schema? If so, you are missing tables and have other problems to fix to get it right. 

  9. You are using obsolete Mysql code that has been completely removed from PHP. You need to use PDO with prepared statements. Post your current DB schema. I cannot tell if you just posted random MIS data or if that is your DB structure as well. If that is your DB it is not correct and needs to be fixed before going further.

     

    https://phpdelusions.net/pdo

     

    * More details on exactly which MIS would be helpful. I assume it means Managment Information System, which one? Is there an API?

  10. You seemed to have missed the "General Form Accessibility" from page 1.

     

    "Make sure that the order in which form elements are accessed is logical and easy. This can sometimes be problematic if tables are used to control layout of form items."

     

    From what I briefly read, that site is not advocating using tables for form layout for accessibility and in fact leans to the opposite. As far as tables in the link you provided, that sections focus is "Handling Multiple Labels" and not about using a table for ease of accessibility. There is nothing about using a table for accessibility leverage.

     

    The answer is still no, do not use tables for form layout.

×
×
  • 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.