I saw your post today and it started making me curious how this could be done using 3DGS. After playing around with a few ideas, I managed to create a working example for you.

Overview :
1) Connects to a PHP file that will scan a TXT file holding coupon codes. (Server Files)
2) It then saves the coupon code to a TXT file in the project folder for the player and then deletes the last coupon from the list. (Coupon will also show on screen)

You can download the example below and test it through my host. There are 50 coupon strings in the text file on my server. You'll be able to test it until the list runs out.

NOTE : Place findCoupon.PHP and coupons.txt on your server and change the couponDir string in the example script.

Hopefully this helps to point you in the right direction and allow you to get this working on your own server.

Coupon Code Example :
https://evoeon.com/freeDownloads/couponReader.zip
NOTE: Security not included.

Have a great weekend,
Brian Pressley (Evo)