Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 get cookie/session/mysql variables into javascript
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 24 September 2004 :  08:57:21  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message

I've been searching the net for 2 days now and still haven't found what I'm looking for.
This is the closest I've got:

http://www.breakingpar.com/bkp/home.nsf/Doc!OpenNavigator&1DB402EE745E8AE687256E4C006F8D59&Remote

But I can't understand it ;)

What I want to do is get the username of a logged in user into my javascript code, and also via the username find some other variables from the mysql-db. If it's possible to read these things directly from asp/php that would be great, then I only need info on how to do the code in the javascript.

I can read the cookie, but still have to sort out only the username from it. Now I get all info from the cookie called Snitz00User. The link above probably tell me how to sort this out but I can't understand it. Is the password in the cookie always the same length?

Can anyone help me?

/Tribaliztic
- www.gotlandrace.se -

pdrg
Support Moderator

United Kingdom
2897 Posts

Posted - 24 September 2004 :  11:45:44  Show Profile  Send pdrg a Yahoo! Message
hmmm If I understand you right you want to access server-side data with clienbt-side script? If this is correct, you'll need to send that data to the client, possibly using hidden fields, but you'll have security issues ...


Go to Top of Page

Podge
Support Moderator

Ireland
3776 Posts

Posted - 24 September 2004 :  12:02:28  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
Could you do something like this;

(from inc header.asp)

Response.Write	"<script language=""JavaScript"" type=""text/javascript"">" & vbNewLine & _
		"<!-- hide from JavaScript-challenged browsers" & vbNewLine & _
		"function openWindow(url) {" & vbNewLine & _
                "var memberUsername = '" & strUsername & "';" & vbNewLine & _
		"	popupWin = window.open(url,'new_page','width=400,height=400')" & vbNewLine & _
		"}" & vbNewLine & _
		"function openWindow2(url) {" & vbNewLine & _
		"	popupWin = window.open(url,'new_page','width=400,height=450')" & vbNewLine & _
		"}" & vbNewLine & _
		"function openWindow3(url) {" & vbNewLine & _
		"	popupWin = window.open(url,'new_page','width=400,height=450,scrollbars=yes')" & vbNewLine & _
		"}" & vbNewLine & _
		"function openWindow4(url) {" & vbNewLine & _
		"	popupWin = window.open(url,'new_page','width=400,height=525')" & vbNewLine & _
		"}" & vbNewLine & _
		"function openWindow5(url) {" & vbNewLine & _
		"	popupWin = window.open(url,'new_page','width=450,height=525,scrollbars=yes,toolbars=yes,menubar=yes,resizable=yes')" & vbNewLine & _
		"}" & vbNewLine & _
		"function openWindow6(url) {" & vbNewLine & _
		"	popupWin = window.open(url,'new_page','width=500,height=450,scrollbars=yes')" & vbNewLine & _
		"}" & vbNewLine & _
		"function openWindowHelp(url) {" & vbNewLine & _
		"	popupWin = window.open(url,'new_page','width=470,height=200,scrollbars=yes')" & vbNewLine & _
		"}" & vbNewLine & _
		"// done hiding -->" & vbNewLine & _
		"</script>" & vbNewLine & _


Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 27 September 2004 :  08:30:50  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message
What I want to do is have the java-ftp-client automatically log in using the username from the cookie (or somewhere else) and the password from the database (or somewhere else).

BUT, I have switched from javascript-based to a java-applet, is that a problem? =) I can't edit the applet, but can I paste the code like with the javascript?

/Tribaliztic
- www.gotlandrace.se -
Go to Top of Page

pdrg
Support Moderator

United Kingdom
2897 Posts

Posted - 27 September 2004 :  09:44:59  Show Profile  Send pdrg a Yahoo! Message
'fraid I have no idea how to help ease your pain - except to say that I personally probably wouldn't start from there, wherever *there* is
Go to Top of Page

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 27 September 2004 :  10:11:06  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message
Ok, what I'm after is the possibility to let my users upload files (multiple files) to the photoalbum and other stuff. I need to have them automatically logged in and to have separate accounts to be able to separate their files.
I have the ultimate ftp java-applet, works like a charm, BUT the users must log on manually and they will never remember their login/pass =)

/Tribaliztic
- www.gotlandrace.se -
Go to Top of Page

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 01 October 2004 :  10:23:33  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message
I solved this!
There was a file in the package with a html-form for the login part, I modded this to get name/pass from the cookie/db.

/Tribaliztic
- www.gotlandrace.se -
Go to Top of Page

pdrg
Support Moderator

United Kingdom
2897 Posts

Posted - 04 October 2004 :  05:43:04  Show Profile  Send pdrg a Yahoo! Message
yay!
Go to Top of Page

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 04 October 2004 :  05:48:40  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message
Sometimes you just have to look alittle more thorough ;)
Sorry for taking up your time!

/Tribaliztic
- www.gotlandrace.se -
Go to Top of Page

pdrg
Support Moderator

United Kingdom
2897 Posts

Posted - 04 October 2004 :  07:21:32  Show Profile  Send pdrg a Yahoo! Message
just pleased you're all sorted :)
Go to Top of Page

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 07 October 2004 :  05:18:34  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message
I found a free (for non-commercial use) java-client:
http://www.unlimitedftp.ca/uftp/index.jsp
There was a html-file with a login box, easy modded to allow automatic login with info from cookie/db.

/Tribaliztic
- www.gotlandrace.se -
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 1.34 seconds. Powered By: Snitz Forums 2000 Version 3.4.07