Announcement

Collapse
No announcement yet.

simple ASP page help - Fixed!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    simple ASP page help - Fixed!

    I'm trying to write a simple ASP page which appears to be receiving the information passed to it correctly and creates the URL for the webpage that we need to run to move the camera as I can see by the information that is output to HomeSeer log, but the webpage with parameters does not seem to get executed.
    If I copy the URl from the log and paste it into a browser it works fine but just won't run from this page.

    As you can tell I'm just dabling in asp to do what I need to do here!

    PHP Code:
    <%@ LANGUAGE=VBScript %>
    <%
    Dim direction
    Dim pos
    Dim url
    pos 
    right(Request.QueryString("data"),1)

    If 
    pos "0" then direction="6"
    If pos "1" then direction="4"
    If pos "2" then direction="2"
    If pos "3" then direction="0"



    url "http://192.168.0.189:89/decoder_control.cgi?user=ptz&pwd=ptz&command=" direction "&onestep=1"

    hs.writelog "Foscam",url

    Response
    .Redirect(url)

    %> 
    Last edited by Rupp; June 28, 2011, 04:59 PM.

    #2
    I can see the problem, you've written it in invisible programming code...

    Try wrapping < html > tags around it instead of code tags and hopefully it will show up...

    Comment


      #3
      Originally posted by mrhappy View Post
      I can see the problem, you've written it in invisible programming code...

      Try wrapping < html > tags around it instead of code tags and hopefully it will show up...
      Looks like Rupp edited the post and put PHP tags around it

      Comment


        #4
        Fixed it by using hs.GetURL rather than the response.redirect.

        PHP Code:
        <%@ LANGUAGE=VBScript %>
        <%
        Dim direction
        Dim pos
        Dim url
        Dim port
        Dim data
        pos 
        right(Request.QueryString("data"),1)

        If 
        pos "0" then direction="6"
        If pos "1" then direction="4"
        If pos "2" then direction="2"
        If pos "3" then direction="0"



        url "http://192.168.0.189"
        port "89"
        data"/decoder_control.cgi?user=ptz&pwd=ptz&command=" direction "&onestep=1"

        hs.writelog "Foscam",url port data

        if pos <>"" then hs.GetURL url,data,FALSE,port

        %> 

        Comment

        Working...
        X