Announcement

Collapse
No announcement yet.

Database password

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Database password

    When you add something to a database, you have the option of encoding it into password form, how do you reverse this when requesting the password data?

  • #2
    You can't decrypt a PASSWORD field.

    If you need something encrypted for the DB, then later decrypted, use the ENCRYPT() and DECRYPT() functions.

    mySQL docs here

    Comment


    • #3
      Yet again,. thanks Max Albert. Your pritty smart at this PHP stuff, do you know how I can get an IP address from someone who signs my guestbook so then I can store it and ban them. Coz I got this annoying git who keeps on putting offensive messages in my guestbook i created and I wanna prevent him from signing it again

      Comment


      • #4
        You can use:
        $HTTP_X_FORWARDED_FOR or $HTTP_IP_ADDR to get the IP of a user accessing your page, then just have that added to the database, and later check to see if the current IP is in the ban table.......

        Comment


        • #5
          i just tried that an it didn't work

          PHP Code:
          $ip $HTTP_IP_ADDR;
          echo 
          "$ip"
          and i tried..

          PHP Code:
          $ip getenv ("HTTP_IP_ADDR");
          echo 
          "$ip"

          Comment


          • #6
            Sorry the other var is :: $REMOTE_ADDR

            Comment


            • #7
              PHP Code:
              if(getenv(HTTP_CLIENT_IP)) {
                
              $ip getenv(HTTP_CLIENT_IP);
              }
              elseif(
              getenv(HTTP_X_FORWARDED_FOR)) {
                
              $ip getenv(HTTP_X_FORWARDED_FOR);
              }
              else {
                
              $ip getenv(REMOTE_ADDR);

              this checks all of em as only some work on certain servers.
              Scott MacVicar

              My Blog | Twitter

              Comment


              • #8
                Thanks, they are working now, I just gotta wait for them to sign it again

                Comment

                widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                Working...
                X