Singapore Shopping Guide - Compare - Myspace Layouts - Loans - Loans

PDA

View Full Version : hide password from page source


omerta
Jan 2nd 2008, 9:37 am
Hi I'm a new member and beginner in php, too.

I have a form in html sth like this:

<form id="form1" name="eggrafi" method="post" action="signup.php">
<label>
<input type="text" name="name" id="textfield" />
</label>
<label>
<input name="password" type="password" id="textfield2" value="" />
</label>
<label>
<input type="submit" name="submit" id="button" value="Εγγραφή" />
</label>
</form>

the user press the submit button and the signup.php opens.
in case someone do not write sth in the field "name" of the form i have the php code:

if($_POST["name"]==NULL)
{
include("arxeio.html");
}

At last in file arxeio.html i have sth like this:

<label>
<input type="text" name="name" id="textfield" />
</label>
<input name="password" type="password" id="textfield2" value="<?php echo $_POST["password"]; ?>" />

I do that because someone who give the password but not the username will have the opportunity to file arxeio.html to give only username and not the password again.

it works fine BUT if someone go to view->page source of the file arxeio.html he can see the password.

My question is how i can hide the password?

omerta
Jan 2nd 2008, 9:38 am
is there any problem ,generally, with that?

if in the page source the password appears?

it appears only in this page... (arxeio.html)

any solution with cookies?

commandos
Jan 2nd 2008, 11:00 am
he would only see it , if he typed it , so its ok for him to see it , since he know it ...

omerta
Jan 2nd 2008, 11:53 am
that's right...:o thanks my friend