Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Goto url in _blank window & auto populate a form and click submit.
Old 11-29-2004, 12:04 PM Goto url in _blank window & auto populate a form and click submit.
Webmaster Talker

Posts: 626
Trades: 0
Here is what I am trying to do:

1. I am going to have a Login box and a password box with a submit button.

2. The user will type in the login info when they click submit it will open the appropriate page in "_blank". It will then take the information that they typed in on my site and populate the fields on the new site and have it automatically click the submit button on the new page.


The Reason:

If a client goes directly to the destination page they have to remember an 8 digit number for their login. I want to set it up that if they login through my site that I will have a database file containing their name (john.smith) for my site and it will have the corresponding 8 digit number login for the destination site ie. 12345678.

so my database file I want to have something like this:

john.smith, 12345678
mary.smith, 87654321
henry.cane, 25436789
phillip.carver, 87653454
etc.
etc.

it will find the right name & 8 digit login and use that 8 digit number on the destination page. The password will not be saved on my computer it will just be transferred into the new page on the destination site.


Can anyone help with this please??

Zinc.
jim.thornton is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-29-2004, 12:27 PM
Minaki's Avatar
Defies a Status

Posts: 1,626
Location: Guildford, UK
Trades: 0
I think what you could possibly do is 're create' the login form on the destination site (Just copy the form elements, so they have the same name, IDs and the form has the same method and action) however, convert the text boxes to hidden fields. You can then populate the hidden fields using ASP or other server side script on your own site, and only have the Login button. If you still want it to open in a new window, I beleive you can set the target property of the form to _blank.

It won't do -exactly- what you said in your spec, but I beleive it would do what you want it to do.

Let me know if you run into any problems, or need clarification/examples etc.
__________________
Minaki Serinde MCP
"Wow, Linux is nearly on-par with Windows ME!"

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Minaki is offline
Reply With Quote
View Public Profile Visit Minaki's homepage!
 
Old 11-29-2004, 01:52 PM
Webmaster Talker

Posts: 626
Trades: 0
Examples would be helpful as I have a little bit of a coding (VB) background but web stuff is new to me.

Also, I definitely want my clients to be able to use their username and my script looks up their 8 digit number. Otherwise, they will still have to look up their 8 digit # every time they login (which is a pain).

Do you know what I mean??
jim.thornton is offline
Reply With Quote
View Public Profile
 
Old 11-29-2004, 04:30 PM
Minaki's Avatar
Defies a Status

Posts: 1,626
Location: Guildford, UK
Trades: 0
Something like this (It all depends on the login form on the destination page, really)

If the destination page looks like:
HTML Code:
<form name="MyForm" id="MyForm" method="post" action="login.asp">
  <p>Username: 
	<input type="text" name="txtUsername" />
	<br />
	Password: 
	<input type="text" name="txtPassword" />
	<br />
	<input type="submit" name="Submit" value="Submit" />
</p>
</form>
Your page could look like:
Code:
<%@LANGUAGE="VBSCRIPT"%>
<%
Dim rsGetUserDetails
Set rsGetUserDetails = Server.CreateObject("ADODB.Recordset")
rsGetUserDetails.ActiveConnection = MyConnectionString
rsGetUserDetails.Source = "SELECT * FROM Users WHERE usr_Username = '" + Session("Username") + "'"
rsGetUserDetails.CursorType = 0
rsGetUserDetails.CursorLocation = 2
rsGetUserDetails.LockType = 1
rsGetUserDetails.Open()
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Login</title>
</head>
<body>
<form name="MyForm" id="MyForm" method="post" action="http://www.destinationsite.co.uk/login.asp" target="_blank">
	<input name="txtUsername" type="hidden" value="<%=(rsGetUserDetails.Fields.Item("Username").Value)%>" />
	<input name="txtPassword" type="hidden" value="<%=(rsGetUserDetails.Fields.Item("Password").Value)%>" />
	<input type="submit" name="Submit" value="Submit" />
</form>
</body>
</html>
<%
rsGetUserDetails.Close()
Set rsGetUserDetails = Nothing
%>
As you can see, all your form is doing is grabbing the details from the DB and populating them into hidden fields. All the user sees is a Submit button, which submits the form to the destination site. Remember to put the full URL of the login script in the Action attribute or it won't work. the trget="_blank" attribute can be removed if you don't want it to open in a new window.
__________________
Minaki Serinde MCP
"Wow, Linux is nearly on-par with Windows ME!"

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Minaki is offline
Reply With Quote
View Public Profile Visit Minaki's homepage!
 
Reply     « Reply to Goto url in _blank window & auto populate a form and click submit.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.23444 seconds with 12 queries