Closed Thread Icon

Topic awaiting preservation: window.location + target="_blank" issue ......please help ;) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8306" title="Pages that link to Topic awaiting preservation: window.location  +  target=&amp;quot;_blank&amp;quot; issue ......please help ;)" rel="nofollow" >Topic awaiting preservation: window.location  +  target=&quot;_blank&quot; issue ......please help ;)\

 
Author Thread
Ultra
Nervous Wreck (II) Inmate

From:
Insane since: Jan 2002

posted posted 09-13-2002 08:03

I'm making a cpanel login for my clients everything is working fine but i'd like to open the page in a new windows and i'm getting a bit confuse.........and thing are not working can someone have a look at the code and give me a hand ?

thank you

Ultra


code:
<SCRIPT language=javascript>
<!-- Begin
function Login(form) {
var username = form.username.value;
var password = form.password.value;
if (username && password) {
var cpanel = "http://" + username + ":" + password + "@" + "139.**.**.86" + ":2082/" ;
window.location = cpanel;
}
else {
alert("Please enter your username and password.\n");
}
}
// End -->
</SCRIPT>




and here is the login code:


code:
<FORM name=login>
<input type="text" class="formfield" name="username">
<input type="password" class="formfield" name="password">
<input name="button" type="button" class="formfield" onClick=Login(this.form) value="Login"; >
<script language=JavaScript>
<!--
document.login.username.focus();
document.login.password.value='';
// -->
</script>
</FORM>




how would i get :
http://username assword@139.**.**.86:2082/

to open in a new windows ?


Thank you

Ultra

Ultra
Bluelines

{Edit-Petskull} Killed yer slimes... that'll be $8.50..

[This message has been edited by Petskull (edited 09-13-2002).]

reitsma
Maniac (V) Mad Scientist

From: the bigger bedroom
Insane since: Oct 2000

posted posted 09-13-2002 08:18


^ clickie.



[This message has been edited by reitsma (edited 09-13-2002).]

Ultra
Nervous Wreck (II) Inmate

From:
Insane since: Jan 2002

posted posted 09-13-2002 08:31

that doesn't do it

your link is just to the pop up generator
i need to keep my code to allow the login i just need to make it target=_blank .........but ain't working

Ultra
Bluelines

reitsma
Maniac (V) Mad Scientist

From: the bigger bedroom
Insane since: Oct 2000

posted posted 09-13-2002 08:38
quote:
how would i get : http://username assword@139.**.**.86:2082/

to open in a new windows ?



paste this code into the <head> of your document:

code:
<script language="JavaScript" type="text/JavaScript">
<!-- Enable Stealth Mode to hide from really old browsers
// code courtesy of GurusNetwork.com

function openWindow() {
popupWin = window.open('http://username assword@139.**.**.86:2082/ ','login','menubar=yes,toolbar=yes,location=yes,directories=yes,titlebar=yes,status=yes,scrollbars=yes,resizable=yes');
}
// Disable Stealth Mode -->
</script>




Paste this code into the <body> of your document:
Open window with link:

code:
<a href="javascript :openWindow();">YOUR LINK HERE</a>



OR open window with form button:

code:
<form action="post">
<input type="button" value="YOUR BUTTON NAME HERE" onclick="openWindow();" />
</form>



your "target=_blank" works for a HTML tag.
GURU's popup works for javascript window opening.
hope this helps.


Ultra
Nervous Wreck (II) Inmate

From:
Insane since: Jan 2002

posted posted 09-13-2002 08:47

my link is dynamic
the gnerated link always change from each customer
the link in the code that i posted is generate from each username and password
so using your code won't do any good or am i wrong ?

Ultra
Bluelines

reitsma
Maniac (V) Mad Scientist

From: the bigger bedroom
Insane since: Oct 2000

posted posted 09-13-2002 08:58

i would say that you are wrong...

code:
function Login(form) {
var username = form.username.value;
var password = form.password.value;
if (username && password) {
var cpanel = "http://" + username + ":" + password + "@" + "139.**.**.86" + ":2082/" ;
popupWin = window.open(cpanel,'login','menubar=yes,toolbar=yes,location=yes,directories=yes,titlebar=yes,status=yes,scrollbars=yes,resizable=yes');
}
else {alert("Please enter your username and password.\n");
}
}




Ultra
Nervous Wreck (II) Inmate

From:
Insane since: Jan 2002

posted posted 09-13-2002 09:35

thank you ................i feel so silly.....

working perfectly
thank you very much

Ultra


Ultra
Bluelines

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 09-13-2002 13:02

Ultra: Is it wise to send the username and password through the URL? It may not be an issue but it isn't very secure.

___________________
Emps

FAQs: Emperor

Petskull
Maniac (V) Mad Scientist

From: 127 Halcyon Road, Marenia, Atlantis
Insane since: Aug 2000

posted posted 09-13-2002 14:59

hmm... that's an interesting postulate..

Is there a way to pass the user and password some way other than the url?

um... in a frameset, maybe?

what else would work?


Code - CGI - links - DHTML - Javascript - Perl - programming - Magic - http://www.twistedport.com
ICQ: 67751342

Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 09-13-2002 15:02

Hidden values in the form. Assigned dynamically.

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 09-13-2002 15:15

Still not entirely secure without a secure connection.

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 09-13-2002 15:34

Cookies or sessions?

___________________
Emps

FAQs: Emperor

Petskull
Maniac (V) Mad Scientist

From: 127 Halcyon Road, Marenia, Atlantis
Insane since: Aug 2000

posted posted 09-14-2002 03:14

I'm talking about the kind of usernames and passwords that are url-encoded...

such at ftp and telnet stuff done thru the browser..


Code - CGI - links - DHTML - Javascript - Perl - programming - Magic - http://www.twistedport.com
ICQ: 67751342

Ultra
Nervous Wreck (II) Inmate

From:
Insane since: Jan 2002

posted posted 09-17-2002 08:08

hmmm what are the risk involved by using this ?


Ultra
Bluelines

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 09-17-2002 13:34

Ultra: It depends on what you are using it for I suppose. I did once write the Hitchhikers Guide to the Galaxy a little note when I spotted that they logged you in using GET rather than POST but if it doesn't matter or you have some other security measures in place (or someone knows that it isn't a problem) then I wouldn't worry about it.

I'd probably do something like this:

code:
<form name="login" action="javascript:windowPop();" method="post">
<input type="text" class="formfield" name="username" />
<input type="password" class="formfield" name="password" />
<input name="button" type="button" class="formfield" value="Login" />
</form>



and then sort everything out server-side but thats just me (you could just use target="_blank" in there as well I suppose)

___________________
Emps

FAQs: Emperor

Ultra
Nervous Wreck (II) Inmate

From:
Insane since: Jan 2002

posted posted 09-17-2002 17:51

The login is jusst on the main page to a hosting site
to allow client to loging to theyre "cpanel" from the webhosting website
instead of typing the url manually and then filling login/pass in a popup htaccess box

Ultra

Ultra
Bluelines

« BackwardsOnwards »

Show Forum Drop Down Menu