Click to See Complete Forum and Search --> : [RESOLVED] Very basic doubt on HTML POST.
seenuFour
12-14-2009, 11:11 AM
I am not able to pass parameters using HTML POST.
Here is my html code.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>A Sample Form Using POST</TITLE>
</HEAD>
<BODY BGCOLOR="#FDF5E6">
<H2 ALIGN="CENTER">A Sample Form Using POST</H2>
<FORM ACTION="https://www.independentinc.com/scripts/insupport.exe/db_connect"
METHOD="POST">
<CENTER>
Login:
<INPUT TYPE="TEXT" NAME="name" VALUE="<name>"><BR>
Password:
<INPUT TYPE="TEXT" NAME="password" VALUE="<pwd>"><BR>
Office:
<INPUT TYPE="TEXT" NAME="officeNum" VALUE="<num>"><P>
<INPUT TYPE="SUBMIT">
</CENTER>
</FORM>
</BODY>
</HTML>
When I click on submit button, I see the logon screen prompting username/password.
It should've been logged me in, when I clicked on submit button.
Can anybody point out the error please.
svidgen
12-14-2009, 11:57 AM
The variables you're trying to POST in don't appear to be listed anywhere on the default sign-in form for the page. Additionally, there is a plethora of other fields which may be required for the sign-in--the script could also be checking the REFERRER header to ensure that sign-ins are coming from the default sign-in form.
Are you the author of the target site?
seenuFour
12-14-2009, 12:03 PM
Hi Jon Wire,
Thanks for your reply.
I am not the author of the target website.
I purposely changed the names of the variables that the site is looking for.
Here is the actual code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>A Sample Form Using POST</TITLE>
</HEAD>
<BODY BGCOLOR="#FDF5E6">
<H2 ALIGN="CENTER">A Sample Form Using POST</H2>
<FORM ACTION="https://www.independentinc.com/scripts/insupport.exe/db_connect"
METHOD="POST">
<CENTER>
Login:
<INPUT TYPE="TEXT" NAME="i_1_name" VALUE="<value>"><BR>
Password:
<INPUT TYPE="TEXT" NAME="i_1_password" VALUE="<value>"><BR>
Office:
<INPUT TYPE="TEXT" NAME="i_1_client_fl_salesperson" VALUE="<value>"><P>
<INPUT TYPE="SUBMIT">
</CENTER>
</FORM>
</BODY>
</HTML>
Above, I am showing the real values as <value>, just for security purpose.
Please advise.
Thanks a lot!
svidgen
12-14-2009, 12:08 PM
If you can't get this to work, you ought to contact the owner of the website. As I already stated, their form submits a lot more data than yours does--and they could be doing any number of checks to ensure that logins are coming from their form. Or even worse, your login attempts could be considered hack-in attempts by their sysadmins.
Contact that site owner and make sure what you're doing is acceptable--and if it is, they will be able to tell you exactly what you need to POST to ensure a successful login.
seenuFour
12-14-2009, 12:12 PM
Hi Jon Wire,
The website admin sits next to me. Its his request that I create such a automatic login from another application.
I am trying to test using my simple HTML POST form, whether it works end-to-end.
The site am trying to access expects 3 login parameters, that I am passing already.
Can you please put some light as to why I still get stuck at the login prompt
Srinivas
svidgen
12-14-2009, 04:36 PM
Start by asking what parameters you need to pass in.
seenuFour
12-14-2009, 05:09 PM
Hi Jon Wire,
I was successful by taking your suggestion.
I was missing one more required parameter.
When I sent all 4, I was able to login using my simple form.
Although, am stuck again at the login prompt, from this application. I guess, I have to study the application integration, before implementing it.
Thanks a lot! :)