Help with an error...



Hi,

I am currently working on a php script that will be called by cron. But I
have an error that keeps coming up.

Parse error: syntax error, unexpected T_VARIABLE inmail_report.php on

What I am trying to do is a simple php script to send me a report
everynight. Any clues as to why? Also does anyone know of a site with mail
srcipts that are ran on the cli?

---------------------------------------------
<?php
$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);

//This is a simple email to give me the status from yesterday.
//This connect the script to the db
require_once('mysql_connect.inc');

$query = "Select ip, date, time, CONCAT(city, ', ',country) as location
from ips where country !=' ' and date = current_date() order by
date,time,country asc;";
$result = mysql_query($query)

$mailsend = mail("terrorpup@xxxxxxxxx","The IP's that Attacked
$hostname", "The following are ip's that have try to attack your
system.\r\n\r\


if ($result) { //if that ran ok, display the record
echo "<table width=\'150\'><tr><td> Country </td><td> # of
Attacks
</td></tr>";

//fetch and print the records

while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
echo "<tr><td align=\'left\'>$row[0]</td><td><div
align=\'right\'>$row[1]</div></td></tr>";
}

echo '</table>';

mysql_free_result ($result); //free up the resources

} else { //if did not run ok

echo '<p>This could not be display due to a system error.
We apologize
fore any incovenience.</p><p>'. mysql_error() . '</p>';

}

","From:fyre@xxxxxxxxxxxx\r\nReply To:fyre@xxxxxxxxxxxx");
print("$mailsend");
?>



.



Relevant Pages

  • Re: Can this be done with PHP?
    ... would display and part B would not run and the php script would terminate. ... With a bit of modification you could cope with error messages ...
    (comp.lang.php)
  • Re: [PHP] Help with an error...
    ... I am currently working on a php script that will be called by cron. ... Parse error: syntax error, unexpected T_VARIABLE inmail_report.php on ... echo 'This could not be display due to a system error. ...
    (php.general)
  • Regular Expression Wildcard
    ... PHP script that would read the file, display it in the browser for me. ... to remove the date entry (just from the display, not the logs). ... retaining the end-of-line and I get a new line in the source code. ...
    (comp.lang.php)
  • Re: Display a friends name when searched for by phone number
    ... u need to find out how many line (array), and use a FOR to explode them into ... > I am wanting this PHP script to seach through a small phonebook file and ... > Would display: ...
    (alt.php)
  • XML HTTP GET does not seem to work in IE6 when used with setTimeout
    ... I am trying to get the output of a php script to be displayed on a page ... var xmlhttp; ... Time will display here!! ... Script Debugger, the value of xmlhttp.responseText does not get ...
    (comp.lang.javascript)