Help with cgi/perl code

Discussion in 'Programming' started by gavin watson, Jun 29, 2010.

  1. #1
    Hello all,

    I hope this is the best place to put my query. The following code is from a CGI file which resides on a device that has a small built in unix based webserver. What currently happens is that the code %61 returns the state of a variable held in the device and will display 'On' or 'Off' depending on a perticular state of the device. What I would like to do is query the variable and have it change the font colour to green if it is 'On' or red if it is 'Off'. I am able to change the code in the device and upload the new CGI page, so it is configurable. Unfortunately I have no idea how to do this, can anyone please help me with this?

    Thank you in advance for your help/advice.

    <td><div align="center"><span class="style1"><br />
          Device 1 is currently<br />
          <span class="style8">%61</span></span><br />
          <br />
        </div>
    </td>
    Code (markup):

    On a separate note, I would also like some help with the following situation, also similar to above in that it is a CGI file that resides on the same device. What I would like is that in the above code, where is says 'Device 1' is it possible to get this text from a separate file, maybe a file called device1.txt where I can chagne the name for the device instead of having it called 'Device 1' it looks at a separate file and fills in the correct name from the external file?

    Again, thank you in advance.
     
    gavin watson, Jun 29, 2010 IP