www.webdeveloper.com
Results 1 to 13 of 13

Thread: MD5 Help

  1. #1
    Join Date
    Sep 2010
    Posts
    9

    MD5 Help

    I have made a basic form, and I need to combine three values within my form, then create an md5 hash of this string.

    Then assign it to a hidden variable.

    My form is here...

    Code:
    <p> 
        <label for="firstname">First Name: </label> 
                  <input id="firstname" type="text" name="firstname" /><br /> 
        <label for="lastname">Last Name: </label> 
                  <input id="lastname" type="text" name="lastname" /><br /> 
        <label for="account">Account Number: </label> 
                  <input id="account" type="text" name="account" /><br /> 
        <label for="housenumber">House Number/Name: </label> 
                  <input id="housenumber" type="text" name="housenumber" /><br />      
        <label for="postcode">Postcode: </label> 
                  <input id="postcode" type="text" name="postcode" /><br />    
        <label for="email">Email: </label> 
                  <input id="email" type="text" name="email" /><br /> 
        <label for="trans_id">Invoice Number(s): </label> 
                  <input id="trans_id" type="text" name="trans_id" /><br /> 
        <label for="amount">Amount Paying: </label> 
                  <input id="amount" type="text" name="amount" /><br /> 
        <label for="notes">Notes: </label> 
                  <input id="notes" type="text" name="notes" /><br /> 
     
     
        <input name="callback" value="http://www.so.co.uk/authorised;http://www.so.co.uk/declined" type="hidden" /> 
        <input name="merchant" value="so" type="hidden" /> 
        <input name="remotepassword" value="so" type="hidden" /> 
        <input name="req_cv2" value="true" type="hidden" /> 
        <input name="options" value="test_status=true" type="hidden" />    
    	
    	<!-- here I need to combine the "trans_ID" input, "amount" input and the "remotepassword" call this variable $digest_this -->
    	<!-- I then need to create an md5 of this string ($digest) and post it as a hidden value called "digest"-->
    
     
    	
        <input name="digest" value="<!--here I need to call the md5 string before posting -->" type="hidden" /> 
       
      
       <input value="Send" type="submit" /> <input type="reset" />*</p>
    Or I have created a pastebin of it here, for easy reading: http://pastie.org/1171757

    So I need to be able to combine the three values into a string, create a md5 of the string, then call the value of the string into a hidden value all before posting the form.

    Thanks for looking

  2. #2
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    Pardon my French, but what is that a "md5 of the string" ?

  3. #3
    Join Date
    Sep 2010
    Posts
    9
    Sorry, I need to generate an md5 hash for the value of the string.

  4. #4
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    Oh, a cryptographic hash value... I see.

    Are you aware that JavaScript is not a proper, safe medium for this kind of applications? As you can not hide the code, any encrypted algorithm is to me decrypted, sooner or later, if someone wants to.

  5. #5
    Join Date
    Sep 2010
    Posts
    9
    Yes I am aware of that.

  6. #6
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428

  7. #7
    Join Date
    Sep 2010
    Posts
    9
    Could you help me combine the string values, place it through the converter than call it back to a hidden value?

  8. #8
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    Do you know JavaScript?

  9. #9
    Join Date
    Sep 2010
    Posts
    9
    No hence why asking for help

  10. #10
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    Do you know any other programming/scripting language? If not, we are wasting our time, as we will have no basis to understand one each other.

  11. #11
    Join Date
    Sep 2010
    Posts
    9
    Yes ruby/rails

  12. #12
    Join Date
    Sep 2010
    Posts
    9
    All sorted now, thanks anyway

  13. #13
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    You are welcome. Still: get a little time to learn JavaScript. You won't regret it

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles