Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2003-11-16
6
Medium Priority
?
353 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 172 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 164 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 164 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

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!

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Loops Section Overview
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

927 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