• home
  • forum
  • my
  • kt
  • download
  • Make a Page That Calculates MD5 Hashes of Input

    Author: 2008-08-16 11:02:52 From:

    First, here is the code

    CODE
    <?php

    $input = $_POST['input']; # The variable for the user's input
    $new = md5($input); # The new string that is the user's input after being hashed

    #Be sure that you change the md5.php in this variable
    #to the filename of this file
    $form = "<center><form action='md5.php' method='POST'>
    <label>Input  </label><input type='text' name='input' /><br /><br />
    <input type='submit' value='Hash it!' /></form></center><!--GreyFox MD5-->";

    if($input ==""){   // If the input it blank, it just displays the empty form

    echo $form;

    }
    else { # If an input has been supplied, it displays the hash and the form
    echo "
    <center>
    $new<br /><br />
    $form</center>";
    }

    ?>


    Well, all this does is it takes the user's input, calculates the MD5 hash of the input, and displays it to the user.

    discuss this topic to forum

    relation tutorial

    No relevant information

    Category

      Ad Management (4)
      Calendars (3)
      Chat Systems (7)
      Content Management (6)
      Cookies and Sessions (8)
      Counters (8)
      Database Related (8)
      Date and Time (9)
      Development (6)
      Discussion Boards (7)
      E Commerce (6)
      Email Systems (9)
      Error Handling (5)
      File Manipulation (10)
      Flash and PHP (4)
      Form Processing (7)
      Guestbooks (8)
      Image Manipulation (3)
      Installing PHP (5)
      Introduction to PHP (9)
      Link Indexing (6)
      Mailing List Management (8)
      Miscellaneous (10)
      Networking (6)
      News Publishing (6)
      OOP (8)
      PEAR (6)
      PHP vs Other Languages (2)
      Polls and Voting (5)
      Postcards (0)
      Randomizing (8)
      Redirection (8)
      Searching (6)
      Security (12)
      Site Navigation (16)
      User Authentication (14)
      WAP and WML (7)
      Web Fetching (8)
      Web Traffic Analysis (15)
      XML and PHP (16)

    New

    Hot