Ok heres my code i used to make an install that validates a serial number and name and whatever else you wanna add, and then it emails you the details such as mac address, time and date activated and the copy that their windows is registered too. You don' have too go to those extremes but the option is their if you want it.
SUF7 Code Place this on your activation screen with 2 text fields with the variables of UserName and UserSerial. This code is for the next button:
Heres the code for the php script validating the details:Code:-- Gets the username and serial from the text fields named UserName -- And UserSerial. sUsername = SessionVar.Expand("%UserName%"); sPassword = SessionVar.Expand("%UserSerial%"); -- Setup the data to be sent. (No md5 though) sCheckScriptURL = "http://www.domain.com/authenticate.php"; tValuesToPass = {reguser = sUsername, regserial = sPassword}; nSubmitMethod = SUBMITWEB_POST; nTimeout = 20; nPort = 80; tAuthData = nil; tProxyData = nil; -- Just some simple stuff to set up strProductName = SessionVar.Expand("%ProductName%"); -- Email address you want to receive the details on strEmailTo = "dwayne121@bigpond.com"; -- Location of the mail script to send the details out. strURL = "http://www.domain.com/mail.php"; -- System Variable Values About The User Passed For The Email userinfo = System.GetUserInfo(); regowner = userinfo.RegOwner; netdetails = System.GetLANInfo(); nicaddress = netdetails.NIC; regorganization = userinfo.RegOrganization; driveserial = Drive.GetInformation(_SourceDrive).SerialNumber; time = System.GetTime(TIME_FMT_AMPM); current_time = System.GetTime(1); date = System.GetDate(DATE_FMT_EUROPE); current_date = System.GetDate(2); emailaddress = "strEmailTo"; -- Prepare the message to be sent local strMessage = ""; strMessage = strMessage.."Product: "..strProductName.."\r\n"; strMessage = strMessage.."Name: "..SessionVar.Expand("%UserName%").."\r\n"; strMessage = strMessage.."Serial: "..SessionVar.Expand("%UserSerial%").."\r\n"; strMessage = strMessage.."Info: "..regowner.."\r\n"; strMessage = strMessage.."Mac Address: "..nicaddress.."\r\n"; strMessage = strMessage.."Reg Organization: "..regorganization.."\r\n"; strMessage = strMessage.."Drive Serial: "..driveserial.."\r\n"; strMessage = strMessage.."Registration Time: "..current_time.."\r\n"; strMessage = strMessage.."Registration Date: "..current_date; local strSubject = "Registration for "..strProductName; local strFrom = emailaddress; local strTo = strEmailTo; -- Create the message data to be sent to the mail.php script: local tblValues = {MailTo=strTo,MailFrom=strFrom,MailSubject=strSubject,MailMessage=strMessage}; local nLastError = Application.GetLastError(); -- Show a dialog box while the persons details are being checked StatusDlg.Show(); StatusDlg.ShowProgressMeter(false); StatusDlg.SetTitle("Validating"); StatusDlg.SetStatusText("Please wait while your details are being checked with the server..."); -- Presto Send to the web and hide the activation dialog box sResult = HTTP.Submit(sCheckScriptURL, tValuesToPass, nSubmitMethod, nTimeout, nPort, tAuthData, tProxyData); local strResult = HTTP.Submit(strURL,tblValues,SUBMITWEB_POST); StatusDlg.Hide(); -- The details were correct. (the installer received a value of one) if sResult == "1" then -- The username and password was right Screen.Next(); else -- Those details provided were wrong. Or no longer in the database. Dialog.Message("ERROR", "Those details are invalid. Or they have been removed from the server", MB_OK, MB_ICONSTOP); end
Mail.php this is the file that will email the details of the user to your email address specified.PHP Code:<?
// Returns '1' if details received are correct, or '0' if the details were incorrect
// Set the table of users
// Add some entries to the table "Username"=>"Serial"
// You must complete all entrie with a comma, except the last table entry(or it won't work)
$user_table = array(
"Test"=>"6771-1863-0916-62376",
"John"=>"6439-6712-0452-34419",
"Mr Smith"=>"0367-9465-9762-61028",
"Gary??"=>"4235-9686-7813-91870",
"NEVER"=>"9861-2206-4899-55662"
);
// Was data posted to the script?
if ($_POST)
{
// Search through the table
foreach($user_table as $username=>$serial)
{
// Check if the details received via the installer are correct
if (($_POST['reguser'] == ("$username")) AND ($_POST['regserial'] == ("$serial")))
{
// The Details Were Correct And Authenticated, Then Send the result to the installer.
echo '1';
exit;
}
}
// The details supplied were not correct.Return the value of 0 to tell the installer to not let the install continue without the proper details
echo '0';
exit;
}
else
{
// The script wasn't sent any post data by the installer. Or it was loaded through a web browser etc.
echo "No Registration data found. h4x0r";
}
?>
PHP Code:<?php
// Send the details received from the users system to yuor email address you specified
$MessageNoSlashes = stripslashes($MailMessage);
$SubjectNoSlashes = stripslashes($MailSubject);
mail( "$MailTo",
"$SubjectNoSlashes",
"$MessageNoSlashes",
"From: $MailFrom\r\n"
."Reply-To: $MailFrom\r\n");
?>

Reply With Quote


