I have the following code (this is just part of one file):
Code: Select all
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
$subject = $_POST['subject'];
$message = $_POST['message'];
global $db_connection;
$sql = "SELECT email FROM EmailAddresses;";
$result = odbc_exec($db_connection, $sql);
// send a message to each e-mail address in the table
while ($row = odbc_fetch_array($result))
{
$email = $row['email'];
echo "mail to: <b>\$email</b>: $email<br>";
send_message($email, $subject, $message);
}
echo "<div class=\"normalFont\">Messages sent.</div>";
}
// if the user wasn't referred by a script, they shouldn't be here
else header("Location: login.php");Code: Select all
mail to: $email: drew_is_my_friend@hotmail.com
mail to: $email: fake_address@hotmail.com
mail to: $email: notreal@test.com
Messages sent.The database is definitely exactly the same on the web server as it is on the local server.
Here's what can be deduced in regard to what's going on with the Web server:
Since no output is being produced, the echo inside the while loop is probably not being executed.
One might think that, since the last echo command inside the if statement ("Messages sent.") is not producing output, the request method may be something other than "post". If this were the case, however, the browser would be redirected to login.php, which it is not.
Any ideas? I'm pretty much stumped.
Thanks,
Jason