Password Protected Directories: Auto login?

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,211
363
Hello,

Could you provide a specific example of the type of script you are using where you need to access password protected content?

Thank you.
 

Rottwild

Registered
Apr 23, 2015
3
0
1
San Diego
cPanel Access Level
Website Owner
Hello,

Could you provide a specific example of the type of script you are using where you need to access password protected content? The URL is my URL.

Thank you.
I found these examples looking for ways to accomplish this task and have not been able to get either of them to work.
Code:
Sub test()
  Set ie = CreateObject("InternetExplorer.application")
  ie.Visible = True
  ie.Navigate ("soft-pak.com/customers/support2/User_Guide_v4.htm" & ActiveCell)
  Do
  If ie.ReadyState = 4 Then
  ie.Visible = False
  Exit Do
  Else
  DoEvents
  End If
  Loop
  ie.Document.Forms(0).all("User").Value = "xxxxxx"
  ie.Document.Forms(0).all("Password").Value = "xxxxxx"
  ie.Document.Forms(0).submit

End Sub
________________________________________________________________________


Sub internetlogon()
  With CreateObject("InternetExplorer.Application")
  .Navigate "soft-pak.com/customers/support2/User_Guide_v4.htm"
  Do until .ReadyState = 4
  DoEvents
  Loop
  DoEvents
  With .document
  .items("username")="xxxxx"
  .items("usernamesend").submit
  End With
  End With
End Sub

________________________________________________________________________


Sub internetlogon()
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
'Go to this Web Page!
IE.Navigate "soft-pak.com/customers/support2/User_Guide_v4.htm"
'Check for good connection to web page loop!
Do
If IE.ReadyState = 4 Then
IE.Visible = False
Exit Do
Else
DoEvents
End If
Loop
'Wait for window to open!
Application.Wait (Now + TimeValue("0:00:01"))
IE.Visible = True
'Send logon information
SendKeys "xxxxxx", True
SendKeys "{TAB}", True
SendKeys "xxxxxx", True
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,211
363
You may want to post to a forum where more discussions of programming occur. The forums here are primarily intended for questions about the cPanel/WHM software itself.

Thank you.