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 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Sep 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Website - button activating element on another site

    Hi CodingForums,

    I'm new to this advanced form of website making, but have some basic html & css knowledge. I have a problem, which I cannot seem to find a solution or How-To anywhere so I hope you guys can help me out.

    I'm making 2 websites, where the first one is supposed to have a button, which when activated sends information to the second website, so the second website knows it's activated. From that information, the second website should light a box which indicates that the button from that specific account (logged in on the first site) has pressed the button. Also that light box has to be able to be turned off again.

    All I have right now is the basic set up of the two websites and a basic button on the first site.

    Hope it's not too complicated but I'm really lost in this. If it's in the wrong section of the forums, please let me know and I'll create in again in the right section.

    Thanks in advance

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,492
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    When the button has been pressed on the 1st website, does the person on the 2nd website need to see it light-up while they are viewing a web page (live), or can the light-up appear when the web page loads or is refreshed? This makes a big difference in the scripting.

    And when you say it "sends information", do you mean it just sends something that says the button is pressed (with a user ID), or are you dealing with more information than that?

    How "instantaneous" does this button/light transaction need to be? .1 second, 5 seconds, 30 seconds, ... ?

    Can you describe what this is for? There are also buttons that are physical buttons that use WiFi to send the button press to the internet. The button can be a pushbutton or switch of some kind. It can send an SMS text, twitter, email, data to website, etc.


    And just so you know, there are two different ways to look at this ...

    1) The user presses a button and something is set in a database on their website. The 2nd website periodically queries the 1st website to see if the button has been pressed, and can also reset it.

    2) The user presses a button and their website sends a request to the 2nd website telling them it was pressed. The 2nd website acknowledges the press and the 1st website turns off their button when the 2nd website lets them know it has seen it.

    The difference is subtle. The 1st website is either passive or aggressive in letting the 2nd website know the button has been pressed.






    .
    Last edited by mlseim; 11-04-2013 at 02:27 PM.

  • #3
    New to the CF scene
    Join Date
    Sep 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by mlseim View Post
    When the button has been pressed on the 1st website, does the person on the 2nd website need to see it light-up while they are viewing a web page (live), or can the light-up appear when the web page loads or is refreshed? This makes a big difference in the scripting.

    And when you say it "sends information", do you mean it just sends something that says the button is pressed (with a user ID), or are you dealing with more information than that?

    How "instantaneous" does this button/light transaction need to be? .1 second, 5 seconds, 30 seconds, ... ?

    Can you describe what this is for? There are also buttons that are physical buttons that use WiFi to send the button press to the internet. The button can be a pushbutton or switch of some kind. It can send an SMS text, twitter, email, data to website, etc.


    And just so you know, there are two different ways to look at this ...

    1) The user presses a button and something is set in a database on their website. The 2nd website periodically queries the 1st website to see if the button has been pressed, and can also reset it.

    2) The user presses a button and their website sends a request to the 2nd website telling them it was pressed. The 2nd website acknowledges the press and the 1st website turns off their button when the 2nd website lets them know it has seen it.

    The difference is subtle. The 1st website is either passive or aggressive in letting the 2nd website know the button has been pressed.

    .
    Yes it's supposed to be viewed live so I guess it should be updated automatically all the time. The information is just supposed to be that it has been pressed (with a user ID), nothing more than that.

    It has to be close to instant because the user of the 2nd website is supposed to be able to see which box lights up first, meaning that I have multiple users using the 1st website, they all press the button at some point, but the administrator using the 2nd website has to be able to see who pressed it first.

    Well it's just supposed to be a button on a website, since it's all supposed to be done on a computer on a website. The button would be preferred to be a switch button, but it should only be able to be switched off again by the administrator using the 2nd website.

    The 1st example you're describing fits the idea of the website perfectly. That is how it's supposed to work, I believe.

  • #4
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,492
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    So, it is sort of like Jeopardy. The contestants each see the same thing and when they push their buttons, only the first one pressed will light up? How many computers with the button might there be at any one time?

    One other question ... for each of the computers with buttons, is the ID a user ID that pertains to logging in, or is the ID a computer ID, pertaining to the computer that is being used?

    Is this going to be something like in a classroom where all 30 students each have an iPad and the teacher is the "2nd computer"?

    EDIT:
    I also want to ask ... does this have to be two separate websites? And you mean totally separate website, not web pages on the same website? You do realize that with one website (one web page), the main person would be seeing one screen, and the other 10 people would be seeing a different screen ... all viewing the website at the same time. Again, it would be nice to know what your purpose is. Also, there will always be a 0-1 second delay, so it can never be "instant". I would say that one second is not "instant"?


    .
    Last edited by mlseim; 11-04-2013 at 05:05 PM.

  • #5
    New to the CF scene
    Join Date
    Sep 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by mlseim View Post
    So, it is sort of like Jeopardy. The contestants each see the same thing and when they push their buttons, only the first one pressed will light up? How many computers with the button might there be at any one time?

    One other question ... for each of the computers with buttons, is the ID a user ID that pertains to logging in, or is the ID a computer ID, pertaining to the computer that is being used?

    Is this going to be something like in a classroom where all 30 students each have an iPad and the teacher is the "2nd computer"?

    EDIT:
    I also want to ask ... does this have to be two separate websites? And you mean totally separate website, not web pages on the same website? You do realize that with one website (one web page), the main person would be seeing one screen, and the other 10 people would be seeing a different screen ... all viewing the website at the same time. Again, it would be nice to know what your purpose is. Also, there will always be a 0-1 second delay, so it can never be "instant". I would say that one second is not "instant"?


    .
    Well, yeah same principle, but they all have to light up, just in a way so that the admin can see in which order they were pressed, so it's possible to see who was 1st, 2nd, 3rd, 4th and so on. The amount of computer on the website with the button is supposed to be around 20-30 unique computers.

    The user ID is the log in, because before you get to the button, you as a user has to log in to access it.

    Basicly, that explains it best, yes.

    Well, in what I've already created and are planning to use, it's one website, but you can switch between admin and user login screens. Where they ofcourse see two different pages when logged in. It's supposed to be as you just explained yes. This is a school project, in our "Technology" class. Just as close to instant, 1 second is fine because as you say, it can't be avoided, so that's no problem.

  • #6
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,492
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    This is sort of tricky ...

    I have a proof of concept ... at least the part about each person having a button.

    Here's my idea:
    1) You will be using JQuery Mobile and PHP.
    2) Each person enters a unique ID number (that is like the login).
    3) Once logged-in, a button appears.
    4) When the button is clicked, a server microtime is saved in a SESSION ID.
    5) Their button is then disabled.

    I've tested out the basic test script. You will need to know where your SESSION ID are saved on the server. My idea is that once everyone has pushed their buttons, each person's button is disabled. The admin will have a script that gets all of the SESSION ID and read the microtimes on each one to see the order of buttons received.

    I don't have the script written for the admin person. The admin script will constantly query the SESSION directory/folder and display the SESSIONS as they arrive.

    It sounds like what you're doing is school homework, or an assignment? I have enough to get you started. I will PM you with a link to the zipped files.


  •  

    Posting Permissions

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