Server-side validation - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

new_user2007
Posts: 2
Joined: Sat Mar 31, 2007 9:06 pm

Server-side validation

Do you guys have a more detailed explination on how to use the server-side validation? I didn't quite understand the one there now.

-Thanks
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

Server-side validation method is explained here:
http://www.advancedinstaller.com/user-g ... -page.html

What exactly you don't understand? Give me more details.

Regards,
Gigi
_____________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
new_user2007
Posts: 2
Joined: Sat Mar 31, 2007 9:06 pm

Hi:) i didn't quite understand what to write in the script, if it has to be chmoded on the server.. Could you give a full example please? :)

TU
gigi wrote:Hi,

Server-side validation method is explained here:
http://www.advancedinstaller.com/user-g ... -page.html

What exactly you don't understand? Give me more details.

Regards,
Gigi
_____________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

Here is a code sample (written in PHP):

Code: Select all

<?php

define('LICENSE_VALID',   '601');
define('LICENSE_INVALID', '602');

if(isset($_POST['sn']) && trim($_POST['sn']) != '')
{
  // variables posted by AI serial validation tool
  $sn         = trim($_POST['sn']);
  $languageid = (int) $_POST['languageid']; // you can use this parameter to display a localized error message taken from your database
  
  if($id == '555-555') // TODO: user custom database-linked code to check the license ID
  {
    echo LICENSE_VALID . "\n" . "Serial ID = " . $sn . ' is OK.';
    die();
  }
  else
  {
    echo LICENSE_INVALID . "\n" . "Serial ID = " . $sn . ' is invalid !';
    die();
  }
}
else
{
  echo LICENSE_INVALID . "\n" . "Missing Serial ID !";
  die();
}

?>
Copy this code to a file (.php). In the "Serial Validation" page type the URL where this file is located on your server.

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”