Forum Moderators: coopster
Thanks for the help.
Use an HTML form that feed a PHP script
FORM: // add the other form requirements
<form action ="update.php" method="post">
<input type="text"name="username" value="<?php echo $username;?>">
<input type="password"name="password" value="<?php echo $password;?>">
PHP:
// update.php
<?php
// WE PASS A FEW VAR TO POPULATE A TABLE
$username=$_POST['username'];
$password=$_POST['password'];
// check what's missing
if (isset($_POST['username']) &&!empty($_POST['username']) &&
isset($_POST['password']) &&!empty($_POST['password']) )
// if OK carry on
{
$username=$_POST['username'];
$password=$_POST['password'];
//SQL part
$query = "INSERT INTO **Your table name**(username, password) VALUES ('$username', password('$password'))";
$result= mysql_query ($query);
}
else
{
echo "Sorry, you are missing a Field, please click your back browser"; // or use "header"
}
I have a script that I made for my intranet that charges clients credit cards via authorize.net. In my script, I have to write the username and password in plain text. I do this with mysql connections in an external php file, but feel pretty uncomfortable doing this with the credit card processor just in case anyone gets a hold of the code. Is there a way to encrypt the password for the login without ever needing to display the plain text?
there would be no way someone could get to the code, normally. and if so, the mysql db connect password is trivial anyway, because you'd probably already be hacked if it did happen
personally, I wouldnt worry about it