CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2000
    Posts
    5

    Pull variable from cgi server

    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


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: Pull variable from cgi server

    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured