Requesting a PHP script.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • ShadowUK
    No longer a forum member
    • Oct 2007
    • 1321

    Requesting a PHP script.

    Can I have a simple PHP script that checks Username and Password that I can use in AMS.
  • jackdaniels
    No longer a forum member
    • Mar 2007
    • 533

    #2
    here u go
    -- Retrieve Username and Password
    sUsername = Input.GetText("Input_Username");
    sPassword = Input.GetText("Input_Password");

    -- Convert user/pass combo to MD5 digests
    sUsernameMD5 = Crypto.MD5DigestFromString(sUsername);
    sPasswordMD5 = Crypto.MD5DigestFromString(sPassword);

    -- Initialize variables for submit action
    sCheckScriptURL = "http://www.yourdomain.com/check_user.php";
    tValuesToPass = {username_md5 = sUsernameMD5, password_md5 = sPasswordMD5};
    nSubmitMethod = SUBMITWEB_POST;
    nTimeout = 20;
    nPort = 80;
    tAuthData = nil;
    tProxyData = nil;

    -- Submit to the web
    sResult = HTTP.Submit(sCheckScriptURL, tValuesToPass, nSubmitMethod, nTimeout, nPort, tAuthData, tProxyData);

    -- Check the result ('1' is success)
    if sResult == "1" then
    -- The user is authenticated
    Page.Jump("Page2");
    else
    -- The user is not authenticated.
    Dialog.Message("ERROR", "That user/pass combo is invalid", MB_OK, MB_ICONSTOP);
    end
    Attached Files

    Comment

    • ShadowUK
      No longer a forum member
      • Oct 2007
      • 1321

      #3
      Thank you very much.

      Comment

      Working...
      X