Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

update email notification

Codes here !

Moderators: macek, egami, gesf

update email notification

Postby webwired » Thu Nov 28, 2002 7:12 pm

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: Select all
<?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.";
?>
User avatar
webwired
New php-forum User
New php-forum User
 
Posts: 26
Joined: Sat Nov 23, 2002 5:20 pm
Location: St. Louis, Missouri

Postby webwired » Thu Nov 28, 2002 9:15 pm

Nevermind... LOL... I figured it out... here is the final code in case someone else could use it.
Code: Select all
<?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);
?>
User avatar
webwired
New php-forum User
New php-forum User
 
Posts: 26
Joined: Sat Nov 23, 2002 5:20 pm
Location: St. Louis, Missouri


Return to mySQL & php coding

Who is online

Users browsing this forum: Google [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.