Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. Handling Exceptions...

Handling Exceptions...

Scheduled Pinned Locked Moved The Weird and The Wonderful
databaseapachemysqlcomsysadmin
13 Posts 9 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C ChrisKo 0

    They are just asking for SQL Injection attacks I guess? My guess is that someone forgot to set a development flag to false.

    G Offline
    G Offline
    geekfromindia
    wrote on last edited by
    #3

    Validations like 'Required Field' should be done at browser itself and if not there should be some kind of validation before sending data to DB...

    Keep DotNetting!! GeekFromIndia

    P D 2 Replies Last reply
    0
    • G geekfromindia

      I was surfing on SourceMaking WebSiteCommand Pattern[^] and thought to post a reply to one of their video... I didnt put entered req email field and submitted... Here is the response :laugh: ... warning: Invalid argument supplied for foreach() in /home/httpd/vhosts/quotes.com/httpdocs/mega/modules/node/node.module on line 521. warning: implode() [function.implode]: Invalid arguments passed in /home/httpd/vhosts/quotes.com/httpdocs/mega/modules/node/node.module on line 525. user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 query: SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid INNER JOIN node_revisions r ON r.vid = n.vid WHERE in /home/httpd/vhosts/quotes.com/httpdocs/mega/includes/database.mysql.inc on line 172. E-mail field is required. Invalid CAPTCHA token. The answer you entered for the CAPTCHA was not correct.

      Keep DotNetting!! GeekFromIndia

      C Offline
      C Offline
      Clive D Pottinger
      wrote on last edited by
      #4

      I don't see the problem. I think it is great. Every error message should be so detailed and specific. It let's you know exactly what went wrong. I think this should be a WWW standard. And while we are at it, let's replace all those ambiguous 'dings' that Windows plays when you hit an invalid or inactive button with full-screen error dialogues. Just imagine if this sort of detail came up every time someone entered his/her PIN incorrectly at an ATM or POS: I bet they'd be much more careful about hitting the right keys the next time (especially if the POS device made you scroll through the error message line-by-line - and if you didn't, it would issue another error message!). Verbosity! That's the way to make all those lazy sods pay more attention to what they are doing!

      Clive Pottinger Victoria, BC

      1 Reply Last reply
      0
      • G geekfromindia

        Validations like 'Required Field' should be done at browser itself and if not there should be some kind of validation before sending data to DB...

        Keep DotNetting!! GeekFromIndia

        P Offline
        P Offline
        Paul Conrad
        wrote on last edited by
        #5

        geekfromindia wrote:

        Validations like 'Required Field' should be done at browser itself

        I agree and it amazes me that occasionally people ask how to validate from the database side :eek:

        "I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon

        A 1 Reply Last reply
        0
        • P Paul Conrad

          geekfromindia wrote:

          Validations like 'Required Field' should be done at browser itself

          I agree and it amazes me that occasionally people ask how to validate from the database side :eek:

          "I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon

          A Offline
          A Offline
          Andrew P Holden
          wrote on last edited by
          #6

          Uh, while validating in the browser is nice, don't you need to validate on the server if you want to avoid an attack? What is to stop someone from writing a script to send whatever they want to your server, or turning off JavaScript? I could see the browser validation doing something helpful like highlighting the bad field, while the server validation returns something a bit less friendly, like the name of a real web browser.

          P 1 Reply Last reply
          0
          • A Andrew P Holden

            Uh, while validating in the browser is nice, don't you need to validate on the server if you want to avoid an attack? What is to stop someone from writing a script to send whatever they want to your server, or turning off JavaScript? I could see the browser validation doing something helpful like highlighting the bad field, while the server validation returns something a bit less friendly, like the name of a real web browser.

            P Offline
            P Offline
            Paul Conrad
            wrote on last edited by
            #7

            Andrew P Holden wrote:

            don't you need to validate on the server if you want to avoid an attack?

            Yes, to prevent injection attacks.

            Andrew P Holden wrote:

            What is to stop someone from writing a script to send whatever they want to your server

            Good point. Validation should be done on both ends.

            "I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon

            N N 2 Replies Last reply
            0
            • P Paul Conrad

              Andrew P Holden wrote:

              don't you need to validate on the server if you want to avoid an attack?

              Yes, to prevent injection attacks.

              Andrew P Holden wrote:

              What is to stop someone from writing a script to send whatever they want to your server

              Good point. Validation should be done on both ends.

              "I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon

              N Offline
              N Offline
              Nagy Vilmos
              wrote on last edited by
              #8

              Almost there. Try verifying at the client - the input is of the right type - and then validating at the server. Validation is a business function ad so belongs away from the user interface.


              Panic, Chaos, Destruction. My work here is done.

              P 1 Reply Last reply
              0
              • N Nagy Vilmos

                Almost there. Try verifying at the client - the input is of the right type - and then validating at the server. Validation is a business function ad so belongs away from the user interface.


                Panic, Chaos, Destruction. My work here is done.

                P Offline
                P Offline
                Paul Conrad
                wrote on last edited by
                #9

                williamnw wrote:

                Validation is a business function

                Yes.

                "I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon

                1 Reply Last reply
                0
                • P Paul Conrad

                  Andrew P Holden wrote:

                  don't you need to validate on the server if you want to avoid an attack?

                  Yes, to prevent injection attacks.

                  Andrew P Holden wrote:

                  What is to stop someone from writing a script to send whatever they want to your server

                  Good point. Validation should be done on both ends.

                  "I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon

                  N Offline
                  N Offline
                  neochief
                  wrote on last edited by
                  #10

                  Actually, this is great example why you need to place "php_value error_reporting 0" onto your production sites even if you completelly sure that your last code is right :) By the way, if you interested, this site is build on Drupal CMS. (those ugly errors were by my fault, Drupal is not guilty :)

                  P T 2 Replies Last reply
                  0
                  • N neochief

                    Actually, this is great example why you need to place "php_value error_reporting 0" onto your production sites even if you completelly sure that your last code is right :) By the way, if you interested, this site is build on Drupal CMS. (those ugly errors were by my fault, Drupal is not guilty :)

                    P Offline
                    P Offline
                    Paul Conrad
                    wrote on last edited by
                    #11

                    I would think so :rolleyes:

                    "I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon

                    1 Reply Last reply
                    0
                    • N neochief

                      Actually, this is great example why you need to place "php_value error_reporting 0" onto your production sites even if you completelly sure that your last code is right :) By the way, if you interested, this site is build on Drupal CMS. (those ugly errors were by my fault, Drupal is not guilty :)

                      T Offline
                      T Offline
                      TheGreatAndPowerfulOz
                      wrote on last edited by
                      #12

                      neochief wrote:

                      Drupal is not guilty

                      Is that like saying Rupaul is not guilty? -- LOL

                      Silence is the voice of complicity. Strange women lying in ponds distributing swords is no basis for a system of government. -- monty python Might I suggest that the universe was always the size of the cosmos. It is just that at one point the cosmos was the size of a marble. -- Colin Angus Mackay

                      1 Reply Last reply
                      0
                      • G geekfromindia

                        Validations like 'Required Field' should be done at browser itself and if not there should be some kind of validation before sending data to DB...

                        Keep DotNetting!! GeekFromIndia

                        D Offline
                        D Offline
                        Derek Bartram
                        wrote on last edited by
                        #13

                        It should be done both browser side and server side... Browser to reduce load in the server, and server to prevent security and otherwise issues.

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups