Please i need urgent help.
I'm using advanced installer 15.1,
I created a project for testing, and I used the sample PHP code and SQL query provided in the advanced installer website. (I'm using Xampp Server)
When i run the installer, and put in the wrong serial number, it says "invalid serial number" but when i put the correct one from the database it still says "invalid serial number",
I tried debugging the code, the new code is posted below.
Now it's working fine, if i put a wrong one it says "invalid serial number", if i put the right one from the database it says "correct serial number"
But when i click "Next" button, nothing seems to be happening. And I'm stuck here. Please help me out what am i not doing right??
I have sent the attachment of the AI project.
//Debugged code
<?php
define('LICENSE_VALID', '601');
define('LICENSE_INVALID', '602');
//Datenbank
$db_host = 'localhost';
$db_user = 'root';
$db_pass = '';
$db_name = 'mydb';
// client information table
$clients_tbl_name = 'clients';
$sn_tbl_col = 'serial_no';
## ##
## Server HTTP response to the query issued by Advanced Installer serial validation tool. ##
## ##
function ServerResponse($is_valid, $posted_serial){
$msg_sep = "\n";
// load error messages from your database, using "$lang_id" for localization (optional)
if($posted_serial == '' && $is_valid == false){
return LICENSE_INVALID . $msg_sep . "Missing Serial Number!";
}
if($is_valid == true){
return LICENSE_VALID . $msg_sep . "Serial Number is Correct!";
}
else{
return LICENSE_INVALID . $msg_sep . "Serial Number: " . $posted_serial . ' is not Correct!';
}
}
if(isset($_POST['sn'])){
//User Inputs
$sn = $_POST['sn'];
$email = $_POST['email'];
$additional_information = $_POST['ai'];
//MySQL connection
mysql_connect($db_host, $db_user, $db_pass) or die(ServerResponse(false, $sn));
mysql_select_db($db_name) or die(ServerResponse(false, $sn));
//MySQL Request
$sn_query = "SELECT ". $sn_tbl_col ." FROM ". $clients_tbl_name ." WHERE ". $sn_tbl_col ." = '".mysql_real_escape_string($sn)."'";
$result = mysql_query($sn_query);
// get result set size
if(mysql_num_rows($result) == 0){
// serial number NOT found in database => issue error response
echo ServerResponse(false, $sn);
die();
}
else{
// serial number was found in database => issue SUCCESS response
echo ServerResponse(true, $sn);
die();
}
}
else{
// issue error response
$sn = '';
echo ServerResponse(false, $sn);
die();
}
?>
FOLLOW US
Get the latest news in Application Packaging