User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 362,342 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,743 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 591 | Replies: 2
Reply
Join Date: Jul 2007
Posts: 89
Reputation: Designer_101 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 2
Designer_101 Designer_101 is offline Offline
Junior Poster in Training

Question Redirecting a user HELP!

  #1  
Oct 19th, 2007
I really need help, the code underneith is pretty confising. I have commented where i need the help. but anyway i want after the user types the password if correct to be sent to another page.





function passCheck() {

var atoz = new Array ("m","b","q","d","e","l","g","h","i","j","k",".","m","t","b","q","r","s","t","u","v","/","x","y","z")
var colin;


var d=atoz[11];var h=atoz[7];var t=atoz[13];var m=atoz[0];var l=atoz[5];
var sint= d + h + t + m + l;

var p=atoz[6];var a=atoz[12];var s=atoz[18];var e=atoz[20];


if (document.input.password.value == p + a + s + e)
//i need a statment here to redirect my user to a different page called gmtv.html//
else
alert
("incorrect")
}

</script>

</head>
<body>


<form name="input">
Name: <input type="text" name="username" onchange="javascript:this.value = this.value.toLowerCase();"/>
<br />
Password : <input type="password" name="password" onchange="javascript:this.value = this.value.toLowerCase();" /><br />
<input type="submit" onclick="passCheck()" />
</form>

</body>
</html>


any ideas
Last edited by Designer_101 : Oct 19th, 2007 at 7:04 am.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 6,691
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 23
Solved Threads: 312
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Rebellion Revamped

Re: Redirecting a user HELP!

  #2  
Oct 19th, 2007
Use the replace function or the href property of the location object to do the same.
if (document.input.password.value == p + a + s + e)
{
    /* assuming the the file resides on the same path */
    location.replace('gmtv.html'); 
    /* or use location.href = 'gmtv.html' */
}
else
{
    alert("incorrect");
}
Last edited by ~s.o.s~ : Oct 19th, 2007 at 12:41 pm.
"I don't accept change. I don't deserve to live."

"Working a real job is a win if you're lazy, greedy, or unmotivated. If you're average, you fit right in. And if you're above average, the basic terms of employment and premise of the arrangement is against your interests."
Reply With Quote  
Join Date: Jan 2007
Posts: 2,361
Reputation: MidiMagic is on a distinguished road 
Rep Power: 6
Solved Threads: 89
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Posting Maven

Re: Redirecting a user HELP!

  #3  
Oct 21st, 2007
Realize that any user can look at the code and find out the password.
Daylight-saving time uses more gasoline
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 11:10 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC