PHP Send to Phone/E-Mail
Posted: Sun Apr 25, 2010 10:00 am
OK, so I have a script that lets users leave a message for somebody and that person would have to go to the site, type in their "tag" and see any messages left for them. IS it possible for them to be able to signup and leave a cell phone number, then when a message is sent to their "tag" they would receive a copy of the message via e-mail or sms?? Help would be greatly appreciated!!!! I have posted my code below:
form to send message
php code to actually insert the message into database
form to send message
Code: Select all
<form action="insert.php" method="post">
<fieldset>
<label>License Plate:</label><input type="text" name="tag" />
<label>Message:</label><textarea name="message" cols="55" rows="8"></textarea>
<input type="submit" name="Send" value="Send" />
</fieldset>
</form>Code: Select all
<?php
$con = mysql_connect("localhost","text_tag","db_pass);
$tm=time();
$ref=@$HTTP_REFERER;
$agent=@$HTTP_USER_AGENT;
$ip=@$REMOTE_ADDR;
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("text_tag", $con);
$sql="INSERT INTO testtable (tag, message, tm, ref, agent, ip, tracking_page_name)
VALUES
('$_POST[tag]','$_POST[message]','$tm', '$ref', '$agent', '$ip', '$tracking_page_name')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "Your message has been sent";
mysql_close($con)
?>