Hi Experts,
I have software application that the user must activate with a serial number that we will give him.
This serial number will be valid for X Days. For example 1 x year (365 days) etc.
Following are the steps of our registration process:
1. User download software
2. We email user software registration number based on whether he bought a 1/2/3 year license.
3. User enters this serial number in the software.
4. The software will determine if its valid by checking with our online MySQL database that this serial number has not been registered previously and then allow the further use of the software according to the license period.
5. After the serial number "online checking" has completed the software needs to sent this serial number to our online MySQL database with a request to flag it as been "USED" or "RESERVED" or whatever...... :)
Ok I know this sound quite hectic but I have layout the process in bit detail just incase someone else has got a better idea than this which does not involves too much work.
My solution to this:
For checking and flagging a serial number I have thought to sent the variables via a URL and then have a PHP script doing the work for me on the other side.
***But the problem is how can I determine the result from the script on the Delphi side***
For example:
To flag a serial number it should be quite easy:
I can use ShellExecute() with an url for example: "
http://www.signgenius.com/phpscript.php?serial=1234456343" as parameter and on the PHP site I simply GET the variables from the url and insert it into the MySQL database.
***BUT***
To check whether a serial number has been used prior to flag it I need to receive a response from the script.
I where thinking maybe to fake a page not found (404) error when the serial has been used else a page found (200) if the serialnumber is OK.
------------Questions-----
-------
1) So how can I from the PHP scripts side fake a page not found (404) or found (200) and
2) then in Delphi how can I receive these responses?
3) What would be a good implemention of a serialnumber which has a expiry date encoded? Any examples welcome.
4) And please feel free if you have any better suggestions.