This Page is Still Under Development
";
//Diagnostic Code: Show all variables shipped over from form:
foreach ($_POST as $key => $value)
{
echo "Field ".htmlspecialchars($key)." is ".htmlspecialchars($value)."
";
}
exit;
*/
//Mange Data from form
$User_Name=$_POST["User_Name"];
$h=$i=$j=$k=0;
$Col_Email=array();
/*
for ($i = 1; $i <= 5; $i++)
{
if(!empty($_POST["Col_Email$i"]))
{
echo"Data in Address number: ", $i, "
";
}
}
*/
//Check for missed data entry
for ($i = 1; $i <= 5; $i++)
{
if(empty($_POST["Col_Email$i"]))
{
$j++;
continue;
}
else
{
$Col_Email[$i]=$_POST["Col_Email$i"];
//echo $i, " = ", $Col_Email[$i], "
";
// Validate email
if (filter_var($Col_Email[$i], FILTER_VALIDATE_EMAIL))
{
//echo("$Col_Email[$i] is a valid email address
");
if(empty($_POST["Col_Name$i"]))
{
$Col_Name[$i]="Colleague";
continue;
}
else
{
$Col_Name[$i]=$_POST["Col_Name$i"];
continue;
}
}
else
{
echo("
Email number $i , $Col_Email[$i], is not a valid email address
Please back up one page and enter one valid eMaill address or
delete the letters in this box
or, if you prefer, go ahead and leave the site. ");
exit;
}
//echo $i;
}
}
if($j==5)
{
echo "
You didn't enter any valid eMail addresses.
If you intended to do so, back up one page and make sure you enter at least one valid eMail address in the appropriate eMail address boxes.
If you have decided not to send any eMails to colleagues, you may select your own next page or close your browser.
";
exit;
}
/*
//if($k!==0) exit;
$timestamp = time ();
$date = date("m/d/y", $timestamp);
$time = date("G.i:2", $timestamp);
$user = $_SERVER['REMOTE_ADDR'];
*/
//echo("$User_Email[$i] is a valid email address
");
if(empty($_POST["User_Name"]))
{
$User_Name="Your Colleague";
//continue;
}
else
{
$User_Name=$_POST["User_Name"];
//continue;
}
for ($k = 1; $k <= 5; $k++)
{
//Send eMail invitations to user's colleagues
if(!empty($_POST["Col_Email$k"]))
{
$to = $Col_Email[$k];
$subject = 'An Invitation to Participate in Some Research' ;
$body = "$Col_Name[$k]
I just took a short (5-10 minute) survey on Critical Thinking for which the University of Southern California is seeking input.
The survey is anonymous and quick to complete; it works better on a screen larger than a cell phone.
If you want to do it on your Smart Phone, your using the horizontal layout will make it easier.
This seems like an important line of new research and I am sure USC will appreciate your contribution to their work.
If you have questions about the survey, call Dan Davis at 310 909-3487 or eMail him at dmdavis@acm.org .
$User_Name" ;
mail($to, $subject, $body);
}
else
{
continue;
}
}
echo "
Thank You for Sending the Invitations to Others
If you have an interest in this line of research,
feel free to contact me at any time:
CDR Dan M. Davis, USN, Ret.
eMail: dmdavis@acm.org
Phone No.: 310 909-3487
Web: www.hpc-educ.org
Go to your home page: Home
";
?>