Simple license validation with cURL?

Discussion in 'PHP' started by wvccboy, Mar 10, 2011.

  1. #1
    Hi all,

    I am attempting to run a license key against a remote mySQL DB in PHP. If the key is valid, then things can move forward. If it's not valid, it should say it failed.

    It seems like I will need to use sockets or cURL to make the connection, but I am not sure what code to use. Just looking for some examples on how we could use these functions to run a validation check on the remote server.

    Thanks!
     
    wvccboy, Mar 10, 2011 IP
  2. dgreenhouse

    dgreenhouse Peon

    Messages:
    24
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    cURL has nothing to do with database connections. If you want to use cURL or Sockets, you'll need an actual app (i.e. validate.php?license=20398), that connects to the database and returns the appropriate data. If the app at the remote end is simple enough, you could probably use any number of PHP functions to retrieve the information. i.e. cURL, Sockets, file_get_contents(), etc.

    Here's a link to a tutorial for using cURL to query a remote server:
    (note: I don't have URL privileges yet, so do a google on: Using-Curl-To-Query-Remote-Servers.)
     
    dgreenhouse, Mar 10, 2011 IP
    wvccboy likes this.
  3. wvccboy

    wvccboy Notable Member

    Messages:
    2,632
    Likes Received:
    81
    Best Answers:
    1
    Trophy Points:
    250
    #3
    Perfect response. Thanks for the help!
     
    wvccboy, Mar 10, 2011 IP