Hi there,
I've searched the forums and can't seem to find the answer to this anywhre (apologies if I am mistaken).
The basic problem is that I have a table of data updated online by users taking part in experiments, and I would like the contents of this table, and the results of queries (2 separate problems, although I think the structure would be the same apart from the SQL statement) to be able to be sent to an email account (which the user enters themselves). preferably, a table would be a nice way of sending the data, or (even better) a way in which the data could be easily transfered into a program such as Excel (although I would rather it to go to an email first incase the user downloading doesn't have excel and wants to use the information in some other way, thus ensuring portability of results).
I know how to email variables from PHP;
<?
$MailTo = "$email";
$MailSubject = "Result of Query";
$MailHeader = "From: php@cs.keele.ac.uk";
$vars=$HTTP_POST_VARS;
if($vars) {
foreach($vars as $key=> $value){
print "$key: $value<br />";// Display as html
$MailBody .= "$key: $value\n";
}
mail($MailTo, $MailSubject, $MailBody, $MailHeader); //send mail
}
else {
print("<form action='emailresults.php' method="POST">");
print("Please Enter Your Email :");
print("<input type = 'text' name='email'></input>");
print("<br />");
print("<input type='submit'></input>");
print("</form>");
}
?>
and I know how to query the tables;
$connection=ocilogon("*", "***");
$sql="SELECT FROM paramlist";
$statement=ociparse($connection, $sql);
ociexecute($statement);
However, my problem comes when marrying the 2. Can anyone help me out please? feel free to email me at
u2i59@ugi.keele.ac.uk
thanks in advance everyone
Vickie