The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Help with forms HTML, form not posting data to another html form
brvnbld
post Dec 5 2014, 01:25 AM
Post #1





Group: Members
Posts: 7
Joined: 5-December 14
Member No.: 21,892



Hi, guys, I own a website and i have a form that collects username and password, which i want to post it to another form in another website and login to theirs.

This is the login page in my site.

CODE

<html>
<head>
<title>/title>
<link rel="stylesheet" href="styles/main.css" type="text/css" media="print, projection, screen">
</head>
<body>
<center>
<br><br><br><br><br><br><br><br>
<div style="border:1px solid #000000;background:#EEEEEE;padding-top:15px;padding-bottom:5px;width:350px;">
<font size=+2>Sign In Form</font><br>

<form method=post action="http//www.othersite.com/index.php">
<input type="hidden" name="action" value="logon">
<table border=0>
<tr>
    <td>Username:</td>
    <td><input name="username" type="text" size=30></td>
</tr>
<tr>
    <td>Password:</td>
    <td><input name="password" type="password" size=30></td>
</tr>
    <td></td>
    <td align="left"><input type=submit value="Sign In"></td>
</tr>
<tr>
    <td align="center" colspan=2><font size=-1>Don't have an Account ?</font> <a href="?action=newuser"><font size=-1 color="#0000EE">Sign UP Now !</font></a></td>
</tr>
</table>
</form>
</div>
<br>
</center>
</body>
</html>


i copied their entire login page and just included the form action link, but i dont get it to post it. why?. what is the problem?

Thanks in advance for ur help.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Dec 5 2014, 01:36 AM
Post #2


Programming Fanatic
********

Group: Members
Posts: 1,981
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



You forgot to enclose the form method in quotes. method=post should be method="post". Also, your closing title tag is missing the '<' character.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Dec 5 2014, 03:13 AM
Post #3


.
********

Group: WDG Moderators
Posts: 9,649
Joined: 10-August 06
Member No.: 7



QUOTE(brvnbld @ Dec 5 2014, 07:25 AM) *

i have a form that collects username and password, which i want to post it to another form in another website and login to theirs.

Such a form can be used for phishing. Even if that's not your intention, you shouldn't encourage users to submit their usernames and passwords of other sites.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Dec 5 2014, 03:17 AM
Post #4


.
********

Group: WDG Moderators
Posts: 9,649
Joined: 10-August 06
Member No.: 7



QUOTE(CharlesEF @ Dec 5 2014, 07:36 AM) *

You forgot to enclose the form method in quotes. method=post should be method="post".

That's not always necessary (except in XHTML), though it's good practice: http://www.w3.org/TR/html401/intro/sgmltut.html#h-3.2.2

QUOTE
Also, your closing title tag is missing the '<' character.

Yes that made the whole page appear empty in my browsers.

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
brvnbld
post Dec 5 2014, 03:42 AM
Post #5





Group: Members
Posts: 7
Joined: 5-December 14
Member No.: 21,892



i corrected those errors, still am getting the same issues guys, and thanks for the response.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
brvnbld
post Dec 5 2014, 03:44 AM
Post #6





Group: Members
Posts: 7
Joined: 5-December 14
Member No.: 21,892



QUOTE(Christian J @ Dec 5 2014, 01:43 PM) *

QUOTE(brvnbld @ Dec 5 2014, 07:25 AM) *

i have a form that collects username and password, which i want to post it to another form in another website and login to theirs.

Such a form can be used for phishing. Even if that's not your intention, you shouldn't encourage users to submit their usernames and passwords of other sites.



hi, my intentions are simple. i have some employees , and the other site i mentioned about provides me work. thus i want them not to see the original site, else they would stop working for me.

thanks anyway for pointing out. I will make sure this is not being exploited.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Dec 5 2014, 07:27 AM
Post #7


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



QUOTE(brvnbld @ Dec 5 2014, 09:44 AM) *

hi, my intentions are simple. i have some employees , and the other site i mentioned about provides me work. thus i want them not to see
the original site, else they would stop working for me.


That sounds like you are doing something more than this, and maybe this is what isn't working. Because if all you do is log in to the other site, your employees surely would see the other site.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
brvnbld
post Dec 5 2014, 11:10 AM
Post #8





Group: Members
Posts: 7
Joined: 5-December 14
Member No.: 21,892



no, i have overcome that by using a iframe, that displays only part of the webpage.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Dec 5 2014, 11:15 AM
Post #9


Programming Fanatic
********

Group: Members
Posts: 1,981
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



What was the final verdict? Does the form work now or are you still having problems? If you are having problems then please explain what it is.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Dec 5 2014, 11:21 AM
Post #10


Programming Fanatic
********

Group: Members
Posts: 1,981
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



I just noticed a couple more problems. In the form action attribute you forgot the ':' in the http//www.othersite.com/index.php part of the URL. In the account sign up link you need to place the entire URL in the href attribute, not just the query string.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
brvnbld
post Dec 5 2014, 12:41 PM
Post #11





Group: Members
Posts: 7
Joined: 5-December 14
Member No.: 21,892



QUOTE(CharlesEF @ Dec 5 2014, 09:45 PM) *

What was the final verdict? Does the form work now or are you still having problems? If you are having problems then please explain what it is.



No, the form doesn't work, Pandy user said, the users may see the page even if they login, for that i said, i am using iframe.


The form is not working.

The form does not submit data to the page, instead it just redirects to the login page of the original site.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Dec 5 2014, 02:54 PM
Post #12


Programming Fanatic
********

Group: Members
Posts: 1,981
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



Sounds like you still need to make the other corrections I mentioned. The missing ':' in the href will cause the page to submit to the same domain you are running the sign in page from with the http// part tacked on to the end of the URL. The same thing will happen if you click the create account link.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
brvnbld
post Dec 5 2014, 03:10 PM
Post #13





Group: Members
Posts: 7
Joined: 5-December 14
Member No.: 21,892



QUOTE(CharlesEF @ Dec 6 2014, 01:24 AM) *

Sounds like you still need to make the other corrections I mentioned. The missing ':' in the href will cause the page to submit to the same domain you are running the sign in page from with the http// part tacked on to the end of the URL. The same thing will happen if you click the create account link.



i have corrected them already buddy. but still getting same error..
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Dec 5 2014, 03:44 PM
Post #14


Programming Fanatic
********

Group: Members
Posts: 1,981
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



Well, I just tested the page and when I click the 'Sign In' button I'm taken to your fake URL 'http://www.othersite.com/index.php'. Of course I get a 404 error because it is a fake address but it should work. Here is a corrected copy of your code, try it out and let me know what happens.
CODE
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" href="styles/main.css" type="text/css" media="print, projection, screen">
</head>
<body>
<center>
<br><br><br><br><br><br><br><br>
<div style="border:1px solid #000000;background:#EEEEEE;padding-top:15px;padding-bottom:5px;width:350px;">
<font size=+2>Sign In Form</font><br>

<form method="post" action="http://www.othersite.com/index.php">
<input type="hidden" name="action" value="logon">
<table border=0>
<tr>
    <td>Username:</td>
    <td><input name="username" type="text" size=30></td>
</tr>
<tr>
    <td>Password:</td>
    <td><input name="password" type="password" size=30></td>
</tr>
    <td></td>
    <td align="left"><input type=submit value="Sign In"></td>
</tr>
<tr>
    <td align="center" colspan=2><font size=-1>Don't have an Account ?</font> <a href="http://www.othersite.com/index.php?action=newuser"><font size=-1 color="#0000EE">Sign UP Now !</font></a></td>
</tr>
</table>
</form>
</div>
<br>
</center>
</body>
</html>

This is what the submit URL looks like without the ':' correction:
CODE
file:///C:/Documents%20and%20Settings/CharlesEF/Desktop/http//www.othersite.com/index.php

This is what the 'Sign UP Now' link looks like without the addition of the 'http://www.othersite.com/' part before the query string:
CODE
file:///C:/Documents%20and%20Settings/CharlesEF/Desktop/temp.htm?action=newuser

Notice how the 2 href's are just tacked on to my local computer? Once I made the last 2 corrections the URL's pointed to your fake URL address.

This post has been edited by CharlesEF: Dec 5 2014, 03:52 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Dec 6 2014, 04:04 AM
Post #15


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



QUOTE
no, i have overcome that by using a iframe, that displays only part of the webpage.
Do you hire only employees who cannot figure out what URL is being displayed in an iframe?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
brvnbld
post Dec 6 2014, 12:07 PM
Post #16





Group: Members
Posts: 7
Joined: 5-December 14
Member No.: 21,892



QUOTE(Darin McGrew @ Dec 6 2014, 02:34 PM) *

QUOTE
no, i have overcome that by using a iframe, that displays only part of the webpage.
Do you hire only employees who cannot figure out what URL is being displayed in an iframe?



LOL, yes buddy. they know only to look at the address bar and nothing else..
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 16th April 2024 - 01:08 PM