Check Web

Forum help and suggestions to improve this forum.

Moderator: Rathinagiri

franco
Posts: 818
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Check Web

Post by franco »

I am thinking of leasing my program monthly, And I need a way to check if client has paid.
Has anyone have ideas on this.
My thought is at start of my program go to somewhere to check if clients serial number is there.
I thought a small website with a table or text file. or ip with table or text file to import and check and then update
Any thoughts.
Thanks in advance ...... Franco
All The Best,
Franco
Canada
User avatar
mol
Posts: 3720
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Check Web

Post by mol »

My program calls php program on the web which saves client ID while downloading updates
It's simple to change it to test license and give feedback, I think.
franco
Posts: 818
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: Check Web

Post by franco »

Mol, Thanks for response, where on the web is the php program, and what is in the program.
All The Best,
Franco
Canada
User avatar
mol
Posts: 3720
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Check Web

Post by mol »

There is no access to it. I'll try to prepare some code
User avatar
mol
Posts: 3720
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Check Web

Post by mol »

Hi!
This is my very simple sample as a first preview of my idea:
hhm application:

Code: Select all

/*
 * HMG - Harbour Win32 GUI library Demo
 *
 * Copyright 2002-2008 Roberto Lopez <mail.box.hmg@gmail.com>
 * http://www.hmgforum.com//
 * Activex Sample: Inspired by Freewin Activex inplementation by 
 * Oscar Joel Lira Lira (http://sourceforge.net/projects/freewin).
*/

#include "hmg.ch"

FUNCTION Main()

	DEFINE WINDOW Win1 ;
		AT 0,0 ;
		WIDTH 800 ;
		HEIGHT 500 ;
		TITLE 'ActiveX interaction with PHP on the server' ;
		MAIN 

		DEFINE MAIN MENU

			POPUP "Test"
				MENUITEM "Test ID" ACTION TestId()
			END POPUP 			

		END MENU

		@ 10 , 50 ACTIVEX PHP_Interaction ;
			WIDTH 700  ;
			HEIGHT 400  ;
			PROGID "shell.explorer.2"  

	END WINDOW

	Center Window Win1

	Activate Window Win1

RETURN NIL

*------------------------------------------------------------------------------*
Procedure TestID()
	local cID := ''
	local cAddress := "https://www.mol-systemy.com.pl/hmg/test_id.php?userid="
	
	cID := InputBox ('Test user ID (B, C, D, X will pass test):','Enter user ID','')

	If .Not. Empty ( cId )
		cAddress += cId
		Win1.PHP_Interaction.Object:Navigate(cAddress)
	EndIf

Return
and PHP code on the server:

Code: Select all

<?php
	$licence=array("B","C","D","X");
	$userid = $_GET['userid'];
	if (isSet($userid)) {
		if (in_array($userid, $licence)) {
			echo "Licence is active for user " . $userid;
		}
		else {
			echo "!!!! NO ACTIVE LICENCE FOR USER " . $userid;
		}
	}
	else {
		echo "You didn't pass required parameter!";
	}
?>
franco
Posts: 818
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: Check Web

Post by franco »

Thanks Mol, I do not have a website. I will have to get a website to use this idea, or is there another way to access the information.
This looks good. So in the php program would I have a list to check and update. How is data kept in php.
All The Best,
Franco
Canada
User avatar
mol
Posts: 3720
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Check Web

Post by mol »

I can create account for you at my webserver. You can test it and work as long as you want :-)
In this sample, data is kept in php file, but, it can be stored in sql database.
I can create db on my server for you, it will be accessible by phpadmin.
It's only matter to create php app, I have very small experience with it.


Ps. Sorry for my bad english
User avatar
serge_girard
Posts: 3165
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Check Web

Post by serge_girard »

If it can be stored in sql database then you can access it from your HMG app!

Serge
There's nothing you can do that can't be done...
User avatar
mol
Posts: 3720
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Check Web

Post by mol »

I can create mysql db for testing if you want
User avatar
dragancesu
Posts: 921
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

Re: Check Web

Post by dragancesu »

@serge

if your hosting can, but commercial hosting close connection outside localhost,
in this case program must call some.php with parameters and give result

it's like mol sample
Post Reply