Click to See Complete Forum and Search --> : Pull variable from cgi server


Gudge
February 3rd, 2000, 11:39 PM
I don't have much knowledge in VB but I want to beable to play with a variable that is pulled from a ".pl" file from the cgi-bin dir.

I have the output outputting an integer only value.

So far but don't work:


<script language="VBS">
Sub GetNum
Dim counter
counter = val("http://cgi.*********.com/cgi-bin/counter.pl")
msgbox(counter)
document.write("Visitors: " & Cstr(counter)) <--------- the Cstr is
definetaly
wrong anyway :)
End Sub

-->
</script>




Please Help

Paul Goodyear

Lothar Haensler
February 4th, 2000, 01:35 AM
I would use the following approach:
- place an invisible IFRAME on your HTML form.
- load the .pl into that frame via document.frames["yourframe"].location.href = yoururl
- when the frame has been completely loaded get its contents via document.frames[..].body.innerText. This should return your counter value.
- assign it to a variable and write it to the document.