Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-18-2002, 10:07 PM   PM User | #1
HELLSS
New Coder

 
Join Date: Jun 2002
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
HELLSS is an unknown quantity at this point
Exclamation dynamically changing parts of url's in an html code.

I'm wondering if someone knows a way to have a visitor to a page input 2 fields, ID and password... and apply those fields to url's in already made pages.

So for example in a page would be the link
http://page.com/stuff/something.cgi?ID=SUPPLIEDID&PASS=SUPPLIEDPASS&CONTENT=blahblah

And the bolded parts of the url would be changed to the supplied id and password.

Is this possible with javascript even?

I don't have access to the site the links are to, making my own "interface" for an online game and am thinking of ways to easily allow others to use it as well. Thanks for the help
__________________
blek..
HELLSS is offline   Reply With Quote
Old 06-18-2002, 10:13 PM   PM User | #2
x_goose_x
Regular Coder

 
Join Date: Jun 2002
Location: Montreal, Canada
Posts: 644
Thanks: 0
Thanked 0 Times in 0 Posts
x_goose_x is an unknown quantity at this point
<html>

<head>
<script>
obj = new Array();
x = 0;
tmp = location.search;
function loop() {
tmp = tmp.substring(tmp.indexOf("=")+1,tmp.length);
if (tmp.indexOf("=") > 0) {
obj[x] = unescape(tmp.substring(0,tmp.indexOf("&")));
x += 1;
setTimeout("loop()",10);
}else{
obj[x] = unescape(tmp.substring(0,tmp.length));
whattodo();
}
}
function whattodo(){
// change formname to the actual form name and the field names to the corresponding fields.
document.formname.user.value = obj[0];
document.formname.pass.value = obj[1];
document.formname.content.value = obj[3];
}
</script>
</head>

<body onload="loop();">

</body>

</html>
x_goose_x is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 01:16 AM.


Advertisement
Log in to turn off these ads.