PDA

View Full Version : Report Dead Link Script



incka
01-23-2005, 04:56 AM
I'm trying to get a report dead link script that when people click report, it sends me an email telling me which ID the thing came from.

Does anyone have any idea how to do this?

This is what I tried:


<?php
$to = "sean@incka.com.com";
$subject = "DEAD LINK";
$body = "ID . echo $row['id']; . /n NAME . echo $row['name']; .";
if (mail($to, $subject, $body))
{
echo("<p>Message sent!</p>");
}
else
{
echo("<p>Message delivery failed...</p>");
}
?>

But it didn't work...

r2d2
01-23-2005, 05:56 AM
What happened?

You '.com.com' in your $to variable...

The New Guy
01-23-2005, 06:21 AM
Why use mail anyway? Just shove it in a database table.

incka
01-23-2005, 06:24 AM
Because I have no idea how to shove it in a database table :P

Thanks r2d2, I'll see if that works.

chromate
01-23-2005, 10:32 AM
Did it work? If not, the $body bit might be the problem. Try:



$body = "ID: ".$row['id']."/n NAME: ".$row['name'];

r2d2
01-23-2005, 11:14 AM
Ah yes :) How did I miss that! That wouldnt cause an error though would it? It would just put 'echo', ';' and '.'s in the email? Unless that was how it 'didn't work'...

incka
01-23-2005, 12:35 PM
OK, I'll try that, thanks :)

incka
01-23-2005, 01:44 PM
Works perfect. Thanks guys.

chromate
01-23-2005, 04:03 PM
Ah yes :) How did I miss that! That wouldnt cause an error though would it? It would just put 'echo', ';' and '.'s in the email? Unless that was how it 'didn't work'...

I would have thought the same thing. No special characters that need escaping. But it just looked wrong, which is why I mentioned it :)