•
•
•
•
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 402,008 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 2,430 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: 8195 | Replies: 21
![]() |
•
•
Join Date: Dec 2004
Location: Lincoln Park, Michigan
Posts: 1,744
Reputation:
Rep Power: 7
Solved Threads: 107
You can do that anyway. If someone just views source, and then looks at the path to the external file, they can merely stick that in their browser as a URL, and open it or download it. Your Very best bet, is if you have server side access (for example, you can use ASP files, CGI files, PHP, or something along those lines). This way, the password is stored on the server, and never actually sent to the browser. With javascript, EVERYTHING gets sent to the browser, and is readable by it. There are TONS of free verification CGI's and ASP's, PHP's etc, etc. Also, should you need it to be custom built for some reason, let me know, and I can help with that also.
Yes I know all of this, but this is just for testing purposes, since I just installed Apache and have some sites copied (done by me) on server.Now I would like to make them accessible to few people who would say their opinion.I dont wont everyone out there to see it.
I'm just learning everything and I'm doing this step by step. :mrgreen:
That is the problem. I can program in Java & C too so I know for the compabilities of CGI & PHP.But as I told, everything is for testing purposes only.
I'm just learning everything and I'm doing this step by step. :mrgreen:
That is the problem. I can program in Java & C too so I know for the compabilities of CGI & PHP.But as I told, everything is for testing purposes only.
•
•
Join Date: Dec 2004
Location: Lincoln Park, Michigan
Posts: 1,744
Reputation:
Rep Power: 7
Solved Threads: 107
•
•
Join Date: Dec 2004
Location: Lincoln Park, Michigan
Posts: 1,744
Reputation:
Rep Power: 7
Solved Threads: 107
*.htm file
prva.js file
<link rel="stylesheet" href="prva.css">
<script src="prva.js"></script>
</head>
<body>
<table id="zacetnaTabela" width="300px" height="150px" align="center">
<tr>
<td>
<table border="1" align="center">
<tr>
<td align="center">
<form name="myForm" onsubmit="return preveri(input.value,geslo.value);">
UserName:<br>
<input type="text" name="input"><br>
Password:<br>
<input type="password" name="geslo"><br>
<input type="submit" value="Preveri!" size="15px">
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>prva.js file
function preveri(name,passwd){
if((name=="test")&&(passwd=="test1")){
alert("Pravilen vnos!");
top.window.location = 'seznamStrani.htm'; //<---- PROBLEM
}
else{
alert("NapaÄ?no geslo in/ali uporabnisko ime!");
}
}•
•
Join Date: Dec 2004
Location: Lincoln Park, Michigan
Posts: 1,744
Reputation:
Rep Power: 7
Solved Threads: 107
And The: alert("Pravilen vnos!"); works fine right? It just doesn't redirect the site...
something else to consider... instead of using an "onsubmit" with a submit button, consider using a regular button, with an onclick event... that way you don't have to do a "return function();" You could call the function with the button, and then do a document.formname.submit(); in the javascript...... let me know your thoughts.
Also, Have you considered trying "parent.location" (or maybe it's parent.window.location)
something else to consider... instead of using an "onsubmit" with a submit button, consider using a regular button, with an onclick event... that way you don't have to do a "return function();" You could call the function with the button, and then do a document.formname.submit(); in the javascript...... let me know your thoughts.
Also, Have you considered trying "parent.location" (or maybe it's parent.window.location)
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Connecting To External Javascript File (JavaScript / DHTML / AJAX)
- i want to declare header file in javascript (JavaScript / DHTML / AJAX)
- Error reading XML file in Javascript (JavaScript / DHTML / AJAX)
- JavaScript's window.opener (JavaScript / DHTML / AJAX)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: TXT Plays like a Music File?
- Next Thread: Begining Java...



Linear Mode