Results 1 to 10 of 17

Thread: Day 9 - Lets Make A Game - Part 2 - Become PHP Expert in 30 days

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2014
    Posts
    21

    Default

    Code:
     <input type="hidden" name="secretNumber" value="<?php echo $secretNumber; ?>">
    In this code whats
    Code:
    value="<?php echo $secretNumber; ?>
    does?

  2. #2
    Join Date
    Sep 2003
    Posts
    3,040

    Default

    Quote Originally Posted by Austinwhite View Post
    Code:
     <input type="hidden" name="secretNumber" value="<?php echo $secretNumber; ?>">
    In this code whats
    Code:
    value="<?php echo $secretNumber; ?>
    does?
    In this game, you need to guess secretNumber. This number do not change on each request to the server. It only generated once, on your first visit to the game page, this number is generated.

    When you submit form with your guessed number, how server know what was the secretNumber it generated on previous request ?

    Web server do not have memory, it is like an alzheimer patient, so you have to tell it the secretNumber it generated on each request, if not it will think it did not generated one and generate a new number.

    In out case, we will add it as part of form. But we don't want users see it, so we use <input type="hidden">, these input fields are just like other input field, but invisible to users.
    Become PHP Expert in 30 days
    FreeMarriage.com - Free Online Matrimonial
    FlashWebHost.com - Professional Web Hosting, Designing.

  3. #3
    Join Date
    May 2014
    Posts
    21

    Default

    so in this code the value of the secret number is echoed where??

    i mean... this code is the one to print the value of SecretNumber so does it print the value in the server memory or something? :P

  4. #4
    Join Date
    Sep 2003
    Posts
    3,040

    Default

    Quote Originally Posted by Austinwhite View Post
    so in this code the value of the secret number is echoed where??

    i mean... this code is the one to print the value of SecretNumber so does it print the value in the server memory or something? :P
    Stop trying to hack game. You don't need Cheat Engine for this.

    Just view source code, you will see it
    Become PHP Expert in 30 days
    FreeMarriage.com - Free Online Matrimonial
    FlashWebHost.com - Professional Web Hosting, Designing.

Bookmarks

Posting Permissions

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