-
transfer input text to fields in another website
Hi! I am wondering if there is a way to fill out fields in another website with the input text (or dynamic text) fields from my flash page.
I want to be able to have a sort of 'auto fill' function, where the 'username', 'password' etc. fields in my flash page get transfered to the other website's fields. I had the actionscript set up that looked like:
getURL("http://www,zimbio,com&username=" + userName + "&password=" + passWord)
(not sure if that was the exact way I had it, but you get the idea)
Anyways, some fields (like email and username) worked, but some (like password and 're-enter email', did not work. Is there a solution anybody might know? Your help would be greatly appreciated!
-
Registered User
hi,
That's how you pass variables from one page to another via a GET request.
Notice that it should be
Code:
getURL("http://www.zimbio.com/?username=" + userName + "&password=" + passWord);
Notice that GET requests have a character limit, as the variables are sent with the url... Apart from this limit, if you're doing it correctly, there is no reason why one variable works and another doesn't.
Obviously that passing username / password using the URL is not the best practice.... but it's as (un)safe as POST, just more obvious...
Last edited by nunomira; 07-21-2010 at 07:40 AM.
-
Thanks, I was hoping I was on the right track. Yes, it does pass some, but not all fields, and I dont know why. Is there a better way to do it, so that all the fields will fill?
-
Registered User
Like I said, I see no reason why it wouldn't work for all the fields.
Instead of getURL() you may use the send() method of the LoadVars Class.
Basicaly, all you have to do is using the code available in the example:
Actionscript Code:
var my_lv:LoadVars = new LoadVars(); my_lv.playerName = playerName_txt.text; my_lv.playerScore = playerScore_txt.text; my_lv.send("setscore.cfm", "_blank", "POST");
with your own values.
-
Hi, thanks again. I used the sendVars method, too, but still some fields aren't showing. It is very frustrating..
on(press){
sendVars = new LoadVars();
sendVars.Email ="hello@hello.com";
sendVars.Email2 = "hello@hello.com";
sendVars.Username = "username3";
sendVars.Password = "password";
sendVars.Password2 = "password";
sendVars.send("http://www.zimbio.com/join", "", "POST");
trace(sendVars)
}
I too see no reason why it's not working. I read the source page and all field names are correct. Do you think the fields on the receiving page might have something that is preventing all the variables to not be sent? It has some message scripts after each field (like 'username must begin with a letter', etc.) that might be preventing?
-
Registered User
How are you receiving the variables on the receiving page?
With a server side scripting language such as PHP or are you using JavaScript, or?
-
The receiving page isn't mine, so I have no idea. I was just thinking of a quick way I could set up the fields, like an autofill type thing, but it is proving too difficult when the page isn't mine. Oh well
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|