Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jun 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Generate CGI script based on multiple checkboxes

    I have a 8 input / 4 output audio matrix switch that I want to control from serial. I currently have a simple web page with buttons that link to different CGI scripts. When a button is pressed, it runs a script to output data to the serial port. I would like to have a page with (8) checkboxes on the left, named "Input 1" through "Input 8", and (4) checkboxes on the right labeled "Output 1" through "Output 4" and a "Submit" button. When a user checks "Input 1" and Output 4" for example, I need to send a command to the serial port as "CL2I1O4 T". The I1 corresponds to input 1, and O4 corresponds to output 4. The "T" is what finishes the command to the equipment to be controlled via serial, and the matrix switches as soon as the "T" is entered. These 2 numbers are the only thing that will change on the script based on user input. I made a page with the checkboxes and a submit button, but I am clueless on how to change the serial command output to serial based on user input. Any help would be greatly appreciated!

  • #2
    Super Moderator
    Join Date
    May 2005
    Location
    Southern tip of Silicon Valley
    Posts
    2,872
    Thanks
    2
    Thanked 164 Times in 159 Posts
    Can you post your script and html form code?

  • #3
    New to the CF scene
    Join Date
    Jun 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Would it be easier to give you a link to the files in Dropbox? That way you can have all of the associated files. Here is the link:

    https://www.dropbox.com/sh/fgbbtieb699djon/bWvbBuxBBA

    There are 2 folders- the on titled "Working webpage for Arduino" is the one I am currently using to control my Arduino. The folder titled "New Checkbox PHP" is the one I started for the speaker matrix. The page for the Arduino only has to send a simple command to the serial port (connected to the Arduino) to turn speakers on or off. The checkbox page is the one I am stuck on. I have googled like crazy, but cant seem to put all the pieces together. If there is a better way to do this (the webpage design as well as the CGI script), please let me know. Maybe there is a better way than using a CGI script? I am a good automation guy, but the web interface design is somewhat new to me. The checkboxes seemed to be the only way I could get this to function. It would really be sweet if I could have nice buttons like the Arduino page to select an input and output, but right now I would be thrilled with getting the multiple user inputs into one serial command. Thanks so much for the help!!!

  • #4
    Super Moderator
    Join Date
    May 2005
    Location
    Southern tip of Silicon Valley
    Posts
    2,872
    Thanks
    2
    Thanked 164 Times in 159 Posts
    You probably didn't realize this, but this area is for Perl (CGI and non CGI) related questions. Your question is related to CGI, but is it related to to perl? CGI scripts can be written in any language that can outpout to STDOUT, which is nearly all of them.

    I don't see any Perl scripts in the link you provided, but I do see HTML, PHP and shell scripts. If you need help with any of those areas, then it would be better to post your question in one of these areas.

    HTML and CSS

    PHP

    Other Server Side Languages (which includes shell scripting)

  • #5
    New to the CF scene
    Join Date
    Jun 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    FishMonger-

    I apologize for the mistake, and thanks for letting me know! I will repost on the proper board.


  •  

    Posting Permissions

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