Jump to content

Recommended Posts

i'm trying to make a client for a form on a website. i need to post a password to the site. it's usually done by a password field but I want to do it just with a php script, using http post. but i don't know how a password input field in html encrypts the password--it doesn't make sense that i could just send a php request such as site.com?password=hello123.

any ideas? thanks

Link to comment
https://forums.phpfreaks.com/topic/56595-how-to-post-password-to-website/
Share on other sites

I've used client-side JavaScript to encode the password before POSTing it.  Unless you do that, it's sent cleartext.  My code only used cleartext if the browser didn't support or had JavaScript turned off so that use was transparent, but you could require JS if you had a site you really needed to keep secure.  And with POST, at least it's not in the GET string.  :)

 

The other option is HTTPS.

SendPassword.php

<form id="Form" name="Form" action="EncryptPassword.php" method="POST">
    <input type="text" value="Password" id="Password" name="Password" />
    <input type="button" value="Go" id="Submit" name="Submit" />
</form>

 

EncryptPassword.php

<?php
$Password = md5($_POST['Password']);
header('Location: ReceivePassword.php');
?>

 

Then do whatever in ReceivePassword.php ;).

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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