Author |
Topic |
|
iwps
Starting Member
10 Posts |
Posted - 22 March 2002 : 10:54:22
|
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
|
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
|
|
|
iwps
Starting Member
10 Posts |
Posted - 22 March 2002 : 16:43:25
|
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!!!!!
|
|
|
iwps
Starting Member
10 Posts |
Posted - 24 March 2002 : 17:24:50
|
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?
|
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 24 March 2002 : 17:36:20
|
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
|
|
|
dayve
Forum Moderator
USA
5820 Posts |
|
|
Topic |
|