Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2005
    Posts
    172

    Get folder on the net if email and username = true.

    Hello All

    Am stuck with this script.

    i got 2 input objects and 1 button.

    input1: email
    input2: password
    btn: Go

    On click (btn go)
    Code:
    -- Retrieve Username and Password
    sEmail = Input.GetText("Input_Email");
    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.yordomein.com/check_user.php";
    tValuesToPass = {email_md5 = sEmailMD5, 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
    
    end
    So far so good, don't look at the if and then results.

    I want to on the
    Code:
    -- Check the result ('1' is success)
    if sResult == "1" then
    to get the folder of the email,

    Example: http://yordomein.com/emailfolder
    In this folder there are ini files that get value's for the next page.

    I hope you can help am really stuck int his one.
    Many thanks

  2. #2
    Join Date
    Oct 2005
    Location
    MI
    Posts
    524
    Do your INI files share a common name (i.e. config.ini)?

    Regardless, your script will need to know the name of the target file or be able to dynamically generate it based on a known naming convention. Assuming that this is acceptable to you, I think the only piece left is to download the file from the appropriate directory.

    Code:
    -- Retrieve Username and Password
    sEmail = Input.GetText("Input_Email");
    sPassword = Input.GetText("Input_Password");
    
    -- Convert user/pass combo to MD5 digests
    sUsernameMD5 = Crypto.MD5DigestFromString(sEmail);
    sPasswordMD5 = Crypto.MD5DigestFromString(sPassword);
    
    -- Initialize variables for submit action
    sCheckScriptURL = "http://www.yordomein.com/check_user.php";
    tValuesToPass = {email_md5 = sEmailMD5, password_md5 = sPasswordMD5};
    nSubmitMethod = SUBMITWEB_POST;
    nTimeout = 20;
    nPort = 80;
    tAuthData = nil;
    tProxyData = nil;
    sDownloadURL = "http://www.yordomein.com/";
    sINIFileName = "config.ini";
    
    -- Submit to the web
    sResult = HTTP.Submit(sCheckScriptURL, tValuesToPass, nSubmitMethod, nTimeout, nPort, tAuthData, tProxyData);
    
    -- Check the result ('1' is success)
    if sResult == "1" then
    StatusDlg.Show(); HTTP.Download(sDownloadURL .. sEmail, sINIFileName, MODE_BINARY, nTimeout, nPort, tAuthData, tProxyData); StatusDlg.Hide()
    end
    Hope this helps....
    Yeah right. Who's the only one here who knows the illegal ninja moves from the government?

    ()))))))))o)))))))==============================================

  3. #3
    Join Date
    Apr 2005
    Posts
    172
    Yes very nice, this is what am looking for. Still 1 Q i want to save it to the _SourceFolder.."\\AutoPlay\\Docs\\config.ini. But this aint work now, any idea?

    Many Thanks TJS

  4. #4
    Join Date
    Oct 2005
    Location
    MI
    Posts
    524
    That should have worked. AMS will also allow you to describe a folder on the local machine like this:

    Code:
    "autoplay\\docs\\config.ini"
    When AMS sees this, it appends the above to the source folder automatically.

    Your new code should look like this with a couple corrections I just noticed:

    Code:
    -- Retrieve Username and Password
    sEmail = Input.GetText("Input_Email");
    sPassword = Input.GetText("Input_Password");
    
    -- Convert user/pass combo to MD5 digests
    sUsernameMD5 = Crypto.MD5DigestFromString(sEmail);
    sPasswordMD5 = Crypto.MD5DigestFromString(sPassword);
    
    -- Initialize variables for submit action
    sCheckScriptURL = "http://www.yordomein.com/check_user.php";
    tValuesToPass = {email_md5 = sEmailMD5, password_md5 = sPasswordMD5};
    nSubmitMethod = SUBMITWEB_POST;
    nTimeout = 20;
    nPort = 80;
    tAuthData = nil;
    tProxyData = nil;
    sDownloadURL = "http://www.yordomein.com/";
    sINIFileName = "config.ini";
    sINIDestinationFolder = "AutoPlay\\Docs\\";
    
    -- Submit to the web
    sResult = HTTP.Submit(sCheckScriptURL, tValuesToPass, nSubmitMethod, nTimeout, nPort, tAuthData, tProxyData);
    
    -- Check the result ('1' is success)
    if sResult == "1" thenStatusDlg.Show();
    HTTP.Download(sDownloadURL .. sEmail .. "/" .. sINIFileName, sINIDestinationFolder .. INIFileName, MODE_BINARY, nTimeout, nPort, tAuthData, tProxyData);
    StatusDlg.Hide()end
    Yeah right. Who's the only one here who knows the illegal ninja moves from the government?

    ()))))))))o)))))))==============================================

  5. #5
    Join Date
    Apr 2005
    Posts
    172
    Many thanks TJS.

    But it comes back with a error: On click, Line 26: attempt to concatenate global 'iNIfileName' (a nil value)

    I tryed:
    Code:
    HTTP.Download(sDownloadURL .. sEmail .. sINIDestinationFolder, sINIFileName, MODE_BINARY, nTimeout, nPort, tAuthData, tProxyData);
    But the inifile don't show up.

    Many Thanks

  6. #6
    Join Date
    Oct 2005
    Location
    MI
    Posts
    524
    You should see the issue on line 26. The variable we are using should be exactly sINIFileName. AMS is case sensitive when it comes to variable names.

    It might be easier if you repost a larger section of the script you have so far.

    It can also be helpful to use the action properties dialog to fill in the arguments. Try double clicking on HTTP.Download() in the script editor and see how everything looks from there.
    Yeah right. Who's the only one here who knows the illegal ninja moves from the government?

    ()))))))))o)))))))==============================================

  7. #7
    Join Date
    Apr 2005
    Posts
    172
    Thanks for your replay TJS.
    Before i post it i want to say that i am trying to create some kind of messenger. Not the messenger that was posted before but a messenger with server site function. something like MSN. The script you helped me with is the loggin script. Something like verify your email and pass then load up your contacts etc.

    This is the first page:

    Email:Input_Email
    Pass: Input_Password


    Loggin btn:
    Code:
    -- Retrieve Username and Password
    sEmail = Input.GetText("Input_Email");
    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.yordomein.com/check_user.php";
    tValuesToPass = {email_md5 = sEmailMD5, password_md5 = sPasswordMD5};
    nSubmitMethod = SUBMITWEB_POST;
    nTimeout = 20;
    nPort = 80;
    tAuthData = nil;
    tProxyData = nil;
    sDownloadURL = "http://www.yordomein.com";
    sINIFileName = "config.ini";
    sINIDestinationFolder = "AutoPlay\\Docs\\";
    
    -- Submit to the web
    sResult = HTTP.Submit(sCheckScriptURL, tValuesToPass, nSubmitMethod, nTimeout, nPort, tAuthData, tProxyData);
    
    -- Check the result ('1' is success)
    if sResult == "1" then 
    StatusDlg.Show();
    HTTP.Download(sDownloadURL .. sEmail .. sINIDestinationFolder, sINIFileName, MODE_BINARY, nTimeout, nPort, tAuthData, tProxyData);
    StatusDlg.Hide()
    
    Page.Jump("Page1");
    else 
    
    end

    On the second page it loads the config.ini, and set all your contacts etc.

    If you want the .apz let me know.

    Many thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts