ParaChat Support Forums: autologin passing nick_name to applet - ParaChat Support Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

autologin passing nick_name to applet autologin getting it to work

#1 User is offline   Ozbob Icon

  • Advanced Member
  • PipPipPip
Group:
Members
Posts:
31
Joined:
27-April 05

Posted 27 April 2005 - 02:10 AM

Howdy,

I am trying to set up auto login.

I have been able to pull out nickname from our site cookie, and I have been attempting to follow the autologin instructions, but I am not successful in passing the value for the nick_name to the applet code for login. I can do it by entering the actual real value of the nickname in the applet code, but I am having problems passing the nick_name from the page I have set to pull and pass the nick_name.

Here is the page that gets the nickname, and then attempts to pass to the next page.

First page get cookie etc.


<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Get Cookie</title>
<script language="javascript" type="text/javascript">

/**
* Gets the value of the specified cookie.
*
* name Name of the desired cookie.
*
* Returns a string containing value of specified cookie,
* or null if cookie does not exist.
*/
function getCookie(name)
{
var dc = document.cookie;
var prefix = name + "=";
var begin = dc.indexOf("; " + prefix);
if (begin == -1)
{
begin = dc.indexOf(prefix);
if (begin != 0) return null;
}
else
{
begin += 2;
}
var end = document.cookie.indexOf(";", begin);
if (end == -1)
{
end = dc.length;
}
return unescape(dc.substring(begin + prefix.length, end));
}



</script>

<script LANGUAGE =" Javascript">
function form_vali(){
if (document.login.nick_name.value == ""){
alert("Parachat Error Message: You Must Enter A Name To Login");
return false;
}else{
return true;
}
}
</SCRIPT>

</head>

<body>

<script type="text/javascript">
var solcookie = (getCookie("site_9506080871"));
var username1 = (solcookie.split("&"));
var str = (username1[0]);
var nick_name = (str.substring(2));

document.write((solcookie)+"<br/>");

document.write(username1[0]);


document.write("Substring "+ str.substring(2)+ "<BR>");

document.write("This is the user name: " + nick_name);

</script>

<form onsubmit="return form_vali()"; Name="login" ACTION="paraconnect.html">
<a href="index.html"><IMG height=31 src="http://www.parachat.com/images/parachat_power.gif" width=88 vspace=0 border=0></a>
<p>
<b><font face="Arial,Helvetica"><font size=-1>Name:</font></font></b>
<input type="hidden" size="20" name="nick_name"><br>
<input type="hidden" size="20" name="pass" value=""><br>
<INPUT TYPE="SUBMIT" VALUE="Connect">
</form>


</body>

</html>


Here is second page

I have blanked out group value. If I enter a real value for nick_name in the code below it works. It appears the value is not being passed properly,

Any suggestions folks?

Thanks. Regards Ozbob

<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Para Connect Test Page</title>
</head>

<body>
<p>


<script language="Javascript">

function getEnd(mainStr,searchStr){
foundOffset = mainStr.indexOf(searchStr)
return mainStr.substring(foundOffset+searchStr.length,mainStr.length)
}

function getFront(mainStr,searchStr){
foundOffset = mainStr.indexOf(searchStr)
return mainStr.substring(0,foundOffset)
}


var stringA = document.location.href;

var stringB = getEnd(stringA, "=");
var stringC = getEnd(stringB, "=");
var stringD = getFront(stringB, "&");

var pass = stringC;
var nick_name = stringD;


document.write("<BR>");
document.write("<applet codebase='http://pro5.parachatpro.com/pchat/pro5/classes'");
document.write("code='ParaChat.class' archive='pchat.zip' width='600' height='450'>");
document.write("<param name='cabbase' value='pchat.cab'>");

document.write("<PARAM NAME='ctrl.Nickname' VALUE='");
document.write(nick_name);
document.write("'>");
document.write("<PARAM NAME='PASSWORD' VALUE='");
document.write(pass);
document.write("'>");
document.write("<param name='ctrl.Loginonload' value='TRUE'>");
document.write("<param name='ui.BgColor' value='FFFFFF'>");
document.write("<param name=roam.Group value='xxxxxxxx'>");
document.write("<param name=Channel value='#SMART_Recovery'>");
document.write("<param name='ctrl.Roam' value='true'>");
document.write("<param name='roam.TopRooms' value='#SMART_Recovery,#1Meeting,#clouds,#SMART-Recovery,#Elbow,#SMART2'>");
document.write("<<param name='ctrl.NoSound' value='false'>");
document.write("</applet>");

</SCRIPT>



</body>

</html>
0

#2 User is offline   Ozbob Icon

  • Advanced Member
  • PipPipPip
Group:
Members
Posts:
31
Joined:
27-April 05

Posted 27 April 2005 - 02:43 AM

Howdy,

Solved it by combining pages into one. No need to pass then, working.

Regards,
Ozbob
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users