Link to home
Start Free TrialLog in
Avatar of venks
venks

asked on

Changing Password in Internet server

I have an internet account in which i have been allotted a
User id and a password.To change the pass word i have to go to the ISP's web site ,type my user Id and old password and
new password which is very tedious and a waste of connection time.
I have already written an application in Delphi 3 which makes use of a  RAS  component to connect to the internet account automatically.
Now i want to write a procedure which will change the password through the above application after i  feed all the data like user id,old password ,new password off line.Then when i connect to the net and  click a button the password maintained in the server should  change by sending the necessary data.
Can any one tell me the code in delphi 3 for this(only for changing the password in the server)
regards
venks
Avatar of venks
venks

ASKER

Edited text of question
Hi venks,

have you already looked for code at http://www.rtfm.be/fpiette/indexuk.htm?

Zif.
Avatar of venks

ASKER

Dear Zifnab
I am not too familiar with internet protocols.Kindly guide me as to for which component should i look for?
regards
venks
Hi,

I would suggest you to look at the FtpCli Demo.
There you can let the program automatically fill in the password and userid.

About changing it, I don't know, but I guess it should be the same.

I'll look closer to your problem in a few days... when rush is over here.

Regards, Zif.
Avatar of venks

ASKER

Dear Zifnab
Thanks I will try it out and let you know
regards
venks
Just a quick note, if the user ID & password changing is implemented as a form then what you will need to do is either use a HTTP component or a SOCKET component (harder) (from fpiette above) to "FAKE" a form submission using the method in  the <form method="GET OR POST"> attribute of the HTML which will be either get or post.  If it is GET then things are simple, you just have to encode the form fields on the url ie

changepass.cgi?username=<username>&oldpass=<oldpassword> etc...

Obviously the names of the parameters are those taken from the HTML form.

If the method is post (more likely) then things are somewhat more tricky, you will have to look into the HTTP/1.0 (or 1.1) RFC as to how this is implemented (I can't remember.....)

Note, it may be possible to use the get method even if post is specified in the html form......

If you need some further info, let me know....

I hope this helps, it works with my ISP....

Cheers,

Zac
Avatar of venks

ASKER

Dear Zac
You have to be little more specific.Rather i would like to have the delphi code for it
Regards
venks
ASKER CERTIFIED SOLUTION
Avatar of zac
zac

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of venks

ASKER

Dear Zac
I do not have delphi 4.
But i used another HTTP component did a 'Get 'and got the following code from the server.I will be glad if you could convert this to delphi code (I have delphi 3 c/s)
<html>
<title>Change Your Password</title>
<body background="inmtextb.gif">

<h1 align=center>Change Your Password</h1>
<center>
<strong>What can I do with this form?</strong><br>

You can use this form to change your GIAS access password .  
You will need to select your hostname, enter your username,
old (current) password and desired password (twice).

<hr size=2>
<form method="POST" action="/cgi-bin/password/clus.cgi">
<strong>Hostname</strong><br>

<select name="host" size=1>
<option value="">Choose Your Server Here
<option value="giasbm01">giasbm01.vsnl.net.in
<option value="bom2">bom2.vsnl.net.in
<option value="bom3">bom3.vsnl.net.in
<option value="bom4">bom4.vsnl.net.in
<option value="bom5">bom5.vsnl.net.in
<option value="bom6">bom6.vsnl.net.in
<option value="ad1">ad1.vsnl.net.in
<option value="giaspn01">giaspn01.vsnl.net.in
</select><hr>

<strong>Username</strong><br>
<!..Enter your user name below  (<varyogesh</var).>
<pre>Enter Username (like <var>yogesh</var>):  <INPUT type=text name=username value="" size=40></pre>

<hr>

<strong>Old password</strong><br>
<samp> needed for verification</samp>

<pre>Enter Current Password:         <input type=password name=password size=25 value=""></pre>

<hr>

<strong>New password</strong><br>

<samp>Be sure there are no spelling mistakes and
                  it is 6 to 10 characters long.</samp>
<pre>New password:         <input type=password name=pass size=25 value="">
New password (again): <input type=password name=pass1 size=25 value=""></pre>

<hr>
<input type=submit value="Change my password">
<input type=reset value="Restore defaults">
</center>
<hr size=3>
</form>

</body>
</html>


Frankly you have given me a good lead and i should be awarding the points to you for the troubule you have taken.But just to make my job easy (I do not know HTML) i am asking for this favor.
The points will be awarded to you even if you are not able to help me out.But let me know waht you intend doing.
regards
venks

Venks,

Please remeber that I am "flying blind" now, so I am making assumptions about your HTTP component.

I am assuming that your component supports the POST method (you can see the post method in the html form item - probably best to stick to it rather than use get).

The post method will probably take two parameters a url and a list of name value pairs ie

procedure POST(sUrl, Var : String);

or something similar

I also assume that the server upon which the above file was located is called www.myisp.com (why not?)

NOTE: you may have to encode (MIME) your parameter string if you are using not standard 7 bit ASCII chars.

Anyway on to the code with brief descriptions of how it compares to the HTML (blind knowledge is useless)...

What we are going to do is perform a POST to www.myisp.com/cgi-bin/password/clus.cgi with the relevant variables in this case:

host=giasbm01 // This value represents: giasbm01.vsnl.net.in

The value can be found by looking at the HTML ie ad1 = ad1.vsnl.net.in

password='test' // Your old password
pass='newpass'  // New password 1st time
pass1='newpass' // Ditto second time

Hence you can make a string of your POST variables thus (note I have used hard coded values):
//Note & is the thingy that means another item follows
// Assume postvars declared as string...
PostVars := 'host=giasbm01&password=test&pass=newpass&pass1=newpass';
MyHTTPComponent.Post('http://www.myisp.com/cgi-bin/password/clus.cgi', PostVars)


I hope this provides a solution & perhaps gives you a quick primer on HTML forms....

If you have any further questions let me know....

Laters,

Zac
Avatar of venks

ASKER

Dear Zac
Thanks.I will try out your advice.I am awarding you the points.
If i have any problems i will come back.
Regards
venks