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
 Code Support: ASP (Non-Forum Related)
 Can I read this JAVA code into an ASP variable?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

iwps
Starting Member

10 Posts

Posted - 22 March 2002 :  10:54:22  Show Profile
I saw the attached code posted as an idea for a MOD for banning problem users posting to a forum. However, it's JAVA, not ASP.

Question: Intead of a pop-up "Alert" box, how can I read the value provided by this function into an ASP variable?

THX!

~~~~~~~~~~~~~~~~~~~~~~~ JAVA CODE ~~~~~~~~~~~~~~~~~~~~~~~~
<OBJECT classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
ID=WMP WIDTH=1 HEIGHT=1></OBJECT>

<script>
alert(document.WMP.ClientID);
</script>


HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 22 March 2002 :  13:30:55  Show Profile  Visit HuwR's Homepage
The only way I know how to do tis would be using a form submit, so you would need to maybe hijack the login form.

basically you would use code similar to this


</head>
<OBJECT classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
ID=WMP WIDTH=1 HEIGHT=1></OBJECT>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub submit1_onClick
Dim TheForm
Set TheForm = Document.form1
TheForm.txtClientID.Value = WMP.ClientID
End Sub
-->
</SCRIPT>
<body >

<FORM NAME="form1">
<INPUT TYPE="TEXT" NAME="Name" SIZE=25>
<INPUT TYPE="hidden" NAME="txtClientID" SIZE=25>
<INPUT TYPE="BUTTON" NAME="submit1" VALUE="Submit">
</FORM>
</body>



to fit it into Snitz, you would need to change the forum login button to type "BUTTON" instead of "submit" and add the hidden field to catch the ID

Go to Top of Page

iwps
Starting Member

10 Posts

Posted - 22 March 2002 :  16:43:25  Show Profile
Thank you very much for a direction to follow. I just needed a push in the right direction, and you've certainly given it to me.

I figured already that passing through a hidden field was the only way to do it, since JAVA variables are on the client machine, but ASP variables are on the server. So I figured passing through a field was the only "cross-over" point (upon "SUBMIT of course).

Thanks again!!!!!

Go to Top of Page

iwps
Starting Member

10 Posts

Posted - 24 March 2002 :  17:24:50  Show Profile
There goes one blown weekend (that's what I get for never taking an ASP class, I guess).

Needless to say, my "playing" bombed miserably. It seemed like the variable wasn't present until AFTER submit, which was too late for the ASP go grab it.

I had a thought: Would it be possible to write the value out (in javascript) as an cookie, and then immediately read it back in (with ASP) as a cookie? Since cookies have to be enabled anyway (for username & password), it would seem to work.

Any suggestions on a direction to follow?

Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 24 March 2002 :  17:36:20  Show Profile  Visit HuwR's Homepage
The code I posted should work OK, I tested it, however it DOES reliesy on them logging in to submit the form, however, they only need to do this once, and you could then store the value in your membertable.

There is no other way to do it, unless you do it in global.asa

Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 03 April 2002 :  15:41:16  Show Profile  Visit dayve's Homepage
thanks, I am disabling this Super Cookie right now..

http://www.computerbytesman.com/privacy/supercookiedemo.htm

____________
dayve@burningsouls.com


http://www.nineinchnailz.com - your source for everything nine inch nails !
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 0.25 seconds. Powered By: Snitz Forums 2000 Version 3.4.07