Jump to content

Recommended Posts

Hello all,

 

I have a PHP email script that works great, it sends an email to every user in my database.

 

What I need is a way to display a message (preferably a little message pop up box) after the script is finished sending out it's emails. Right now the only way to tell it's done is thing's stop loading and at the bottom of Firefox it says it stops saying "Loading" and changes to "Done"

 

Any advice? This seems simple enough, but I just can't seem to figure it out.

 

Below is my script.

 

<?php
// Start a session
session_start();


mysql_connect("localhost", "xxxxx", "xxxxxx") or die(mysql_error());
mysql_select_db("xxxxxxxxx") or die(mysql_error());
$id = $_POST['studentid'];
$query="SELECT * FROM members";
$result=mysql_query($query);
$num=mysql_numrows($result); 

$i=0;
while ($i < $num) {
$id=mysql_result($result,$i,"id");
$username=mysql_result($result,$i,"username");
$firstname=mysql_result($result,$i,"firstname");
$lastname=mysql_result($result,$i,"lastname");
$address=mysql_result($result,$i,"address");
$city=mysql_result($result,$i,"city");
$state=mysql_result($result,$i,"state");
$zip=mysql_result($result,$i,"zip");
$phone=mysql_result($result,$i,"phone");
$email=mysql_result($result,$i,"email");
$iba=mysql_result($result,$i,"iba");
$mbd=mysql_result($result,$i,"marchingband_currentdue");
$ctd=mysql_result($result,$i,"choir_currentdue");


$fd = popen("/usr/sbin/sendmail -t","w") or die("Couldn't Open Sendmail");
fputs($fd, "To: $email \n");
fputs($fd, "From: \"LWE Music\" <lwemusic@lwemusic.org> \n");
fputs($fd, "Subject: $firstname $lastname IBA \n");
fputs($fd, "X-Mailer: PHP3 \n\n");
fputs($fd, "To the parents of $firstname $lastname,


This is your LWE Music IBA Statement.
---------------------------------------------------------------------

Student Name: $firstname $lastname (Student ID: $id)

Your current IBA is: $iba

Your current Marching Band Fees are: $mbd

Your current Choir Trip Fees are: $ctd

---------------------------------------------------------------------

You can log into the Member Section by naviagting to lwemusic.org and click on Member Account Log In


Any IBA Transfers can be completed online through the Member Section. 


For any questions about your IBA Balance or current fees, please contact the treasurer through the lwemusic.org Member Section.


If you have forgotten your password, or do not know how to log in, please contact Eric Nush at enush@lw210.org




Thank You,
LWE Music \n");
pclose($fd);
Echo "Emails sent to $email"
?>
<br>

<br>

<?php
++$i;
} 
?>

Link to comment
https://forums.phpfreaks.com/topic/204497-after-query-display-message/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.