Using Javascript to submit a form at another URL

C

Calab

I have a website that requires the user to log in before they can access the
site. I'd like to be able to simply enter my URL and be logged into the
site. Unfortunately, the site does not support the format
http://username:password@URL

What I'd like to do is create a local file on my drive that will load the
site in question into an iframe. Once the page has finished loading, I'd
like javascript to populate the form fields and click the submit button. It
would be great if the page could end up loading as the top document, but I
could live with having my iframe set to 100% of the page size.

Is this possible? If so, how?

Thanks!
 
E

Evertjan.

Calab wrote on 07 apr 2008 in comp.lang.javascript:
I have a website that requires the user to log in before they can
access the site.

How can you login if you cannot access the site first?
The loginpage surely is not on anothere site??
I'd like to be able to simply enter my URL and be
logged into the site. Unfortunately, the site does not support the
format http://username:password@URL

What do you mean by "your url"?
Unfortunately, the site does not support the
format http://username:password@URL

That has nothing to do with a site, it simply is not a valid url on
modern(!) browsers, so your browser will not be able to do anything with
it.
What I'd like to do is create a local file on my drive that will load
the site in question into an iframe.

You mean fake the login page of that site?

Sometimes that can be done, if the site builder is not testing the
session already being established.

However loading the login-page into an ifame will not help you.
Once the page has finished
loading, I'd like javascript to populate the form fields and click the
submit button.

Only on a faked page, not on the page of the site, as modern browsers do
not allow access to an iframe if cross domain.
It would be great if the page could end up loading as
the top document, but I could live with having my iframe set to 100%
of the page size.

Is this possible? If so, how?

Many impossible things would be great.
 
B

Bart Van der Donck

Calab said:
I have a website that requires the user to log in before they can access the
site. I'd like to be able to simply enter my URL and be logged into the
site. Unfortunately, the site does not support the format
http://username:password@URL

It's not something that a web site supports, but a browser. E.g.
Microsoft Internet Explorer only supported it up to version 6.0.

http://support.microsoft.com/kb/834489/en-us

You can install a patch so that it works again for you.
What I'd like to do is create a local file on my drive that will load the
site in question into an iframe. Once the page has finished loading, I'd
like javascript to populate the form fields and click the submit button.

Those form fields can only be approached when the parent page resides
on the same domain as the iframe; same for the submit-action.

http://en.wikipedia.org/wiki/Same_origin_policy

Hope this helps,
 
T

Thomas 'PointedEars' Lahn

Bart said:
It's not something that a web site supports, but a browser. E.g.
Microsoft Internet Explorer only supported it up to version 6.0.

http://support.microsoft.com/kb/834489/en-us

You can install a patch so that it works again for you.

One can as well use Internet Explorer 4.0, set the Security Level to Low and
be online with an account that has Administrator privileges. Or, why not
leave the default setting of sharing your C: partition with everyone else on
the Internet?

,-<http://support.microsoft.com/kb/834489/en-us>
|
| A malicious user might use this URL syntax to create a hyperlink that
| appears to open a legitimate Web site but actually opens a deceptive
| (spoofed) Web site. For example, the following URL appears to open
| http://www.wingtiptoys.com but actually opens http://example.com:
|
| http://[email protected]

There has been a *security bugfix* for Internet Explorer 6 because the
`http:' URI scheme does not support authentication this way for good reasons.

http://tools.ietf.org/html/rfc2616#page-19


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top