Page 1 of 1

Why won't my login script work?

Posted: Sun Mar 21, 2010 6:04 pm
by overdooze
I simply cannot get the script to return my already entered username and password. Why not?!

HTML:

<input id="user" name="user" class="text" type="text" value="Testname" />

<input id="password" name="password" class="text" type="password" value="" />

<form id="LoginForm" name="LoginForm" action="http://www.mywebsite.com/login.php" method="post">

PHP:

<?php

{
$message = "$user";
$message2 = "$password";
mail ("mail@mywebsite.com", "Hello", $message, $message2);

}
?>

I can see no reason why this does not work. Please help - much appreciated!

Re: Why won't my login script work?

Posted: Sun Mar 21, 2010 6:11 pm
by flying_circus

Code: Select all

<?php
  $message = $_POST['user'];
  $message2 = $_POST['password'];
  mail("mail@mywebsite.com", "Hello", $message, $message2);
?>
 
<form id="LoginForm" name="LoginForm" action="http://www.mywebsite.com/login.php" method="post">
  <input id="user" name="user" class="text" type="text" value="Testname" />
  <input id="password" name="password" class="text" type="password" value="" />
</form>

Re: Why won't my login script work?

Posted: Sun Mar 21, 2010 7:53 pm
by overdooze
I added the $POST but I still have the same problem - it just sends a blank e-mail.

Any other suggestions?

Thanks anyhow.

Re: Why won't my login script work?

Posted: Sun Mar 21, 2010 8:13 pm
by flying_circus
overdooze wrote:I added the $POST but I still have the same problem - it just sends a blank e-mail.

Any other suggestions?

Thanks anyhow.
What are you trying to accomplish? What you posted does not appear to be a login script.

If you are trying to send an email, I would recommend reading the manual on the mail function here: http://us3.php.net/manual/en/function.mail.php