[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

html and delphi

Posted on 2005-04-25
8
Medium Priority
?
178 Views
Last Modified: 2010-04-05
i need to autologin into a website, how can i insert all info and click the button login?

for example i want insert user and password and click to login on this form:

<form action="" method="post"><input type="hidden" name="PHPSESSID" value="ef08ebff14f3534f587a9cc2f11f067a" />
    <table width=369 border="0" cellpadding="0" cellspacing="0" align=center>
      <tr>
       
      <td align=left> <font size="2" face="verdana">
E-mail<BR>
<input type="text" name="user" size="30" autocomplete="off"><BR><br>
Password<BR>
<input type="password" name="pass" size="30"><BR><BR>
Copy the verification code that is shown on the right<BR>
<input type="text" name="verificationimg" size="5" maxlength="5" autocomplete="off"> <img src="ac8fa3e6.png">
<br>
<br>
<input type="submit" name="login" value="Sign-In Now"><BR><br>
               
        </font>
        </td>
      </tr>
    </table>
      <br>

</font>
<br><br>
<font size="1" face="verdana">
</font></form>


and i can autoinsert the verification code?
like:
<input type="text" name="verificationimg" size="5" maxlength="5" autocomplete="off"> <img src="ac8fa3e6.png">

please guys let me know.. thanks
0
Comment
Question by:xapsx
  • 4
  • 4
8 Comments
 
LVL 17

Expert Comment

by:geobul
ID: 13865070
Hi,

I suspect that the verification code is shown on that picture "ac8fa3e6.png", right? The purpose of such construction is to prevent automatic logins. I don't think what you're asking is possible. Sorry.

Regards, Geo
0
 

Author Comment

by:xapsx
ID: 13865390
ok then forgot the verification code, so , can i login with user and pass and click the button to log in?
thanks!
0
 
LVL 17

Accepted Solution

by:
geobul earned 2000 total points
ID: 13865689
uses ComObj;

var ie: Variant;

procedure TForm1.Button1Click(Sender: TObject);
begin
  ie := CreateOleObject('InternetExplorer.Application');
  ie.Visible := true;
  ie.Navigate('http://www.YourWebSiteHere.com');
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  ie.Document.forms.Item(0).user.select;
  ie.Document.forms.Item(0).user.value := 'YourUsernameHere';
  ie.Document.forms.Item(0).pass.select;
  ie.Document.forms.Item(0).pass.value := 'YourPasswordHere';
  ie.Document.forms.Item(0).login.Click; // or:  ie.Document.forms.Item(0).submit;
end;

Pressing Button1 will open the page in a IE window. Pressing Button2 will fill and submit the form.

Regards, Geo
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:xapsx
ID: 13866188
really really thanks, u have helped me a lot!

just another question , do u use the ics components? bcuz i want do the same thing with them. but nop, really great example still thanks!
0
 
LVL 17

Expert Comment

by:geobul
ID: 13866521
No, I haven't used ICS. Sorry.
0
 

Author Comment

by:xapsx
ID: 13871880
geo, how can i control the ie?

for example like On WebBrowserDocumentComplete, can u give me tutorial? do u know any tutorial for learn how to use it? thx
0
 
LVL 17

Expert Comment

by:geobul
ID: 13873693
Something like (search at MSDN):

uses ComObj, SHDocVw;

var
  ie: Variant;

procedure TForm1.Button1Click(Sender: TObject);
begin
  ie := CreateOleObject('InternetExplorer.Application');
  ie.Visible := true;
  ie.Navigate('http://msdn.microsoft.com');
  while ie.ReadyState <> READYSTATE_COMPLETE do begin
    Sleep(100);
    Application.ProcessMessages;
  end;
  // here comes the code for DocumentComplete
  ie.Document.forms.Item(1).qu.select; // search form is the second form on the page, i.e. index 1
  ie.Document.forms.Item(1).qu.value := 'FindWindowEx'; // search for what
  ie.Document.forms.Item(1).submit;
end;

Regards, Geo
0
 

Author Comment

by:xapsx
ID: 13881502
thanks geo
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Integration Management Part 2
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month20 days, 5 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question