Been writing a PHP software that I am almost done with.
I need to test the licence to ensure that they only use the software on one domain.
I have everything built on both ends, but am having problems with getting a variable from the remote script to do this. I have been racking my brain for hours.
So, here is the setup. On my main domain I have a php script that checks the Db to see if the receipt number and domain are already regstered. There are three conditions
1. Receipt or URL doesn't exsist = $status = added
2. Receipt Exsists but URL doesn't match = $status = confirmed
3. Any other condition = $status = used
It works great but now I need to pull that variable from another server. I have tried an include, file_get_contents but can't seem to echo $status.
Any thoughts?
I already realize the security risks here and will be protection with ION Cube
Retrieve variable from PHP file on remote server.
Moderator: General Moderators
Re: Retrieve variable from PHP file on remote server.
Try checking your php.ini. I bet you don't have PHP allowed to open remote URL's.
Then file_get_contents() should return the contents of the remote script.
Otherwise, try using CURL*.
Good Luck!
*I originally said WGET, I corrected this after seeing Flapjack's post.
Then file_get_contents() should return the contents of the remote script.
Otherwise, try using CURL*.
Good Luck!
*I originally said WGET, I corrected this after seeing Flapjack's post.
Last edited by omniuni on Fri Jul 24, 2009 6:03 pm, edited 1 time in total.
Re: Retrieve variable from PHP file on remote server.
It seems I will have to do a fsocket open or CURL. Any thoughts?
- andyhoneycutt
- Forum Contributor
- Posts: 468
- Joined: Wed Aug 27, 2008 10:02 am
- Location: Idaho Falls
Re: Retrieve variable from PHP file on remote server.
I don't understand if you're just seeing if a file exists with the appropriate contents on their end, or what the actual setup is. I'm curious why you don't just create and issue a certificate? You could use AES encryption, or some other method of your choosing, to make sure the certificate document they have on their end has all the appropriate credentials that you could compare to your own local data set.
You could certainly just use an fopen or a file_get_contents (as previously suggested) if you were to move to a comparable scheme as the one I'm proposing.
Perhaps you could better explain your problem?
Thanks in advance,
Andy
You could certainly just use an fopen or a file_get_contents (as previously suggested) if you were to move to a comparable scheme as the one I'm proposing.
Perhaps you could better explain your problem?
Thanks in advance,
Andy
Re: Retrieve variable from PHP file on remote server.
I'm an idiot. Thanks Flapjack, for the correction... I meant CURL, not WGET.