Jump to content

how to POST password to website?


hydar

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 ;).

Archived

This topic is now archived and is closed to further replies.

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