Need some help with this small HTML code

Discussion in 'HTML & Website Design' started by dhruvd, Dec 3, 2012.

  1. #1
    Hi All,
    I am back again asking for help ....sorry.

    I know it is very small, but $5 for your help :) (PayPal only)

    Could someone please help me around with Cookie functions for this small game. Cookie can store the value of random number and number of guesses once the browser is re opened ?

    Any help would be great....:)

    Many thanks




     
    dhruvd, Dec 3, 2012 IP
  2. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #2
    Rukbat, Dec 3, 2012 IP
  3. dhruvd

    dhruvd Active Member

    Messages:
    420
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    60
    #3
    Tks Rukbat, I can get the cookie to store the value from the input field but can't seem to work out the number of guess left. Like if a person makes two guesses and closes the browser and then comes back, cookie should be able to read both the last value of random number and number of guesses. Sorry i am not the best with HTML & JS ...
     
    dhruvd, Dec 4, 2012 IP
  4. james andy83

    james andy83 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Go the site (w3school) better way to designing and cms.
     
    james andy83, Dec 4, 2012 IP
  5. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #5
    That's not HTML or Javascript, that's program design. Write down exactly WHAT (not how) you want the program to do in English, not in a programming language. See if there's a cookie. If there is, get the values for ... Generate a random number. Accept a guess. Set a cookie with ... That's how programming is actually done.

    Then you write the code to do what you wrote down.

    Assume that you'll never know when the user leaves the site, so you have to set the cookie at any time something changed that you'll want to know the next time he comes back.
     
    Rukbat, Dec 4, 2012 IP
  6. dhruvd

    dhruvd Active Member

    Messages:
    420
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    60
    #6

    Rukbat,
    I think even a novice would figure out from the html CODE above as to what is happening. Basically this is a number guessing game between 1 & 100. User needs to guess with in 5 trials. I was looking for someone to supply me with the Cookie functions that i can use straight away.
    If you dnt want to help please dnt ruin the thread. I already mentioned i wasn't the best with HTML & JS.
    Anyways, Thanks for your suggestions
     
    dhruvd, Dec 4, 2012 IP
  7. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #7
    That's what I did - create, read and erase a cookie. The code is right there.
     
    Rukbat, Dec 4, 2012 IP
  8. dhruvd

    dhruvd Active Member

    Messages:
    420
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    60
    #8
    Haha.,..I wish i could use it straight :)
     
    dhruvd, Dec 4, 2012 IP