| Author |
Topic Search Topic Options
|
true_king
Groupie
Joined: 05 November 2007
Location: Hell
Status: Offline
Points: 97
|
Post Options
Thanks(0)
Quote Reply
Topic: UserID Posted: 12 May 2008 at 9:36pm |
|
i'm using
function chatter(w,h) { var winl = (screen.width - w) / 2; var wint = (screen.height - h) / 2; var lstr = "ChatRoom/chatroom.asp?txtUsername="& strLoggedInUsername &", 'ChatWindow2', 'toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0,width=700,height=460,top='+wint+',left='+winl" window.open(lstr) }
to open a chat window, where strLoggedInUsername is webwiz logedin username but not working.........
anyway, which string use as username in forum?
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Post Options
Thanks(0)
Quote Reply
Posted: 13 May 2008 at 8:39am |
|
Try:-
txtUsername=<% = strLoggedInUsername %>",
As the variable you are calling is a server side ASP variable and not available client side
|
|
|
 |
true_king
Groupie
Joined: 05 November 2007
Location: Hell
Status: Offline
Points: 97
|
Post Options
Thanks(0)
Quote Reply
Posted: 13 May 2008 at 11:03am |
|
Ya it working... i'm using aspchatnow to make a chatbox.... i'm using this,
ChatRoom/chatroom.asp?txtUsername=King
but no one in right panel of active userlist..... but if i do it from default.asp(aspchatnow) and enter a name it open a new popup window with same url,
ChatRoom/chatroom.asp?txtUsername=King
but it working how?
|
 |
true_king
Groupie
Joined: 05 November 2007
Location: Hell
Status: Offline
Points: 97
|
Post Options
Thanks(0)
Quote Reply
Posted: 13 May 2008 at 11:50am |
|
i'm using this,
<form> <p align="center"> <input type=button href="#" value="Open ChatZone" name="Chatter" OnClick="chatter(709,481);" </p> <SCRIPT LANGUAGE="javascript"> function chatter(w,h) { try { var winl = (screen.width - w) / 2; var wint = (screen.height - h) / 2; var username = '<%= strLoggedInUsername%>'; if(username=='Guest') { alert("You Must Login In Order To Use This Feature."); } else { window.open('ChatRoom/ChatRoom.asp?txtUsername='+username, 'ChatWindow2', 'toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0,width=700,height=460,top='+wint+',left='+winl)} } catch(e) { alert("Unable To Open Chat Window, Maybe Pop-Ups Are Blocked."); } } </SCRIPT> </form>
but itz not secure from client any idea?
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Post Options
Thanks(0)
Quote Reply
Posted: 13 May 2008 at 12:02pm |
|
The only way to make it truly secure is to pass the username across server side.
You may be able to modify web wiz forums and ASPchatNow to both use session variables to pass across the username.
|
|
|
 |
true_king
Groupie
Joined: 05 November 2007
Location: Hell
Status: Offline
Points: 97
|
Post Options
Thanks(0)
Quote Reply
Posted: 13 May 2008 at 12:57pm |
|
ok if i sending session variable from web wiz forums to aspchatnow..... how aspchatnow got it?
i know asp.net methode,
session.add("") session.item.add("")
what is it in asp?
btw is session can be hack using javascript injection?
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Post Options
Thanks(0)
Quote Reply
Posted: 13 May 2008 at 1:00pm |
|
Sessions are server side so can not be affected by client side javascript as session varaibles are stored on the server and are not passed across to the clients browser.
To set a session is ASP use:-
Session("Username") = strLoggedInUsername
And to read in back in use:-
strLoggedInUsername = Session("Username")
|
|
|
 |
true_king
Groupie
Joined: 05 November 2007
Location: Hell
Status: Offline
Points: 97
|
Post Options
Thanks(0)
Quote Reply
Posted: 13 May 2008 at 1:02pm |
|
also i need to clear session during log off.... how do this in webwiz or when clicking close button of aspchatnow...(let i put code session remove when click onto log out button of aspchatnow, but if user click on close button then?)
|
 |