Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have a simple php form and mysql connection setup. The form collects data inserted by a user. I need to know when someone posts data and what that data is. I am trying to have php handle this by sending the results by email.
My results script already prints the table of the results:
$query = mysql_query("SELECT * FROM details WHERE $metode LIKE '%$search%'
LIMIT 0, 50");
while ($row = @mysql_fetch_array($query))
{
$variable1=$row["id"];
$variable2=$row["firstname"];
$variable3=$row["lastname"];
$variable4=$row["address"];
$variable5=$row["city"];
$variable6=$row["telephone"];
$variable7=$row["contact"];
//table layout for resultsprint ("<tr>");
print ("<td>$variable1</td>");
print ("<td>$variable2</td>");
print ("<td>$variable3</td>");
print ("<td>$variable4</td>");
print ("<td>$variable5</td>");
print ("<td>$variable6</td>");
print ("<td>$variable7</td>");
print ("</tr>");
}What might I insert (if possible) to have these results also emailed to me?
BTW, I am hosting this on my own server so I have full access to whatever changes and sendmail functions on this server (linux SME Server).
Thx Craig Jensen

Well you can use the mail function provided in php to sort out the things.
But for mail function to work you sendmail must be properly configured i.e sendmail should be able to send emails through conventional methods.
try using the mail functions instead of print in your script like this
mail ( "ur address", "subject","$variable1\n$variable2 ....","any additional headers you wanna send");
This should send the result of the query to you mail address.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |