update email notification

  • Thread starter Thread starter Anonymous
  • Start date Start date
A

Anonymous

Guest
I was needing a way that my customers could securely update their credit card information, so I created a simple php form, using an include for the connection (that I put in the cgi-bin, so it couldn't be seen), that would post their new info into a database. Now what I am wanting is a way to know when someone has posted to the database, so that I can hurry up and get the information out before it is potentiall hacked into. Is there a way to either have the same form that is posting to the database, email me a notification, or a way that the database can alert me, which I don't see how that would be possible. I have included the code for the page that the form posts to.
Code:
<?php
include_once "../cgi-bin/update/header.php";
$sqlquery = "INSERT INTO creditcards
VALUES('$firstname','$lastname','$email','$domain','$address','$city','$state','$zipcode','$country','$phone','$cc_number','$cc_expiration','$comments')";
$results = mysql_query($sqlquery);
mysql_close();
print "Thank you for updating the credit card information for $domain.";
?>
 
Nevermind... LOL... I figured it out... here is the final code in case someone else could use it.
Code:
<?php
include_once "../cgi-bin/update/header.php";
$sqlquery = "INSERT INTO creditcards
VALUES('$firstname','$lastname','$email','$domain','$address','$city','$state','$zipcode','$country','$phone','$cc_number','$cc_expiration','$comments')";
$results = mysql_query($sqlquery);
mysql_close();
print "Thank you for updating the credit card information for $domain.";

$myname = "The server";
$myemail = "an@emailaddress.com";

$contactname = "Billing department";  
$contactemail = "billing@yourdomain.com"; 

$message = "Credit card information for the domain $domain has been updated."; 
$subject = "Credit card info change"; 

$headers .= "MIME-Version: 1.0\r\n"; 
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; 
$headers .= "From: ".$myname." <".$myemail.">\r\n"; 
$headers .= "To: ".$contactname." <".$contactemail.">\r\n"; 
$headers .= "Reply-To: ".$myname." <$myreplyemail>\r\n"; 
$headers .= "X-Priority: 1\r\n"; 
$headers .= "X-MSMail-Priority: High\r\n"; 
$headers .= "X-Mailer: Just My Server"; 

mail($contactemail, $subject, $message, $headers);
?>
 
Back
Top