Solved

How to login to member are on website through boxes on exe?

Posted on 2003-11-16
6
330 Views
Last Modified: 2010-04-05
Hello,
Is there any way I can login to a member area on a website using an exe?
I would like to have 2 boxes, username and password.
Then a users submits these and it will login to the member area in IE and open the page logged in.
If anyone knows how I can do this i would REALLY appreciate the help, I have been trying for a while but have never done anything like it before.
Thanks
John
0
Comment
Question by:Custom-Hosting
6 Comments
 
LVL 17

Accepted Solution

by:
Wim ten Brink earned 43 total points
ID: 9758658
Depends on the login mechanism of a website. Some sites are set up to be secure, requiring authentication. If you use the Indy components then you'll need to set user name and password in the request property and set BasicAuthentication to true. Other sites just expect the username and password to be part of the POST data that is send to the server. In that case you have to use the TidHTTP.Post method, providing username and password in a separate stream or stringlist.
It's worse if you want to log in to e.g. Yahoo because Yahoo requires client-side encryption. If you log in to Yahoo then a Java-Script in the client calculates a hash value, then sends the hashed value to the server for verification.

In other words, there is no -generic- method to log in to any site. You first have to examine the website itself to check how the login information must be send to it.
0
 

Assisted Solution

by:Smortex
Smortex earned 41 total points
ID: 9759042
Maybe you can do this like that :
1 - Take a look to the login page source in order to find the submission form :

<form method="post" action="/login.php" name="DoLogin" [...]>
  Login : <input type="edit" name="login" [...]>
  Password : <input type="edit" name="pass" [...]>
  <input type="submit">
</form>

2 - Edit this "Form". You may change the input type to "hidden", and you can of course remove all the text between the inputs. In the login and password input, add "value="%s"" Take a look to the "action" property of the form, complete it if it is not a full url (beginning with http://...). It may look like this :

<form method="post" action="http://www.mypage.com/login.php" name="DoLogin">
  <input type="hidden" name="login" value="%s">
  <input type="hidden" name="pass" value="%s">
</form>

3 - Create a form with a TEdit for the username, an other for the password, and a button.

4 - On the button's event, write a html file including :
 -> the modified html-form with the informations of your software (You can use : "Format(myForm,[LoginEdit.Text,PasswordEdit.Text]);"). This may write (in my example) :
 -> A javascript function to auto-submit the form

It may llok like this :

<html>
  <head>
    <script>
      function LogMe() {
        document.DoLogin.submit();
      }
    </script>
  </head>
  <body onLoad="LogMe();">
    <form method="post" action="http://www.mypage.com/login.php" name="DoLogin">
      <input type="hidden" name="login" value="username">
      <input type="hidden" name="pass" value="password">
    </form>
  </body>
</html>

This work quite well, bug the password is written in the file, so it is important to remove the file as soon as it is not used.

Hope that's help !

Regards
0
 
LVL 26

Assisted Solution

by:EddieShipman
EddieShipman earned 41 total points
ID: 9764797
0
 

Author Comment

by:Custom-Hosting
ID: 9796301
Hey,
Thanks to everyone that helped.
I decided to use a TWebBrowser and just navigate to a login.html page which had the login form and open it in _blank so it opened IE for the member area.
I will split to points for everyone that helped.
Thanks again,
John
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Reconfigure Delphi Install? 2 51
How to build JSON File in Delphi 6 3 32
how to change, disabled button color FMX ? 1 32
Delphi: sending SMS on android platform 1 19
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

776 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