0

The user can click a button to view another day's information. On one click is tomorrow, next click is in 2 days, 3 clicks = 3 days... etc.

Here is my code, as of right now it will work one time (show only one days information) but then it will not go any further on additional clicks. Any idea? Thank you!

CODE EDIT:

$(document).on("click", "#day-right", function(event){
            <?php timeSelect(); ?>
            document.getElementById("date").innerHTML = "<?php echo $dateSelect ?>";
        });

PHP REF

    function timeSelect() {
                static $extraDays = 1;
                global $dateSelect;
                $dateSelect = date("mdY", strtotime("+" . "$extraDays" . " day"));
                $extraTime++;
                }
Ben L
  • 127
  • 1
  • 1
  • 13
  • you can't execute php from js (like you are doing), you need to do an ajax request – Gumma Mocciaro May 13 '16 at 14:57
  • Really? Can you give me an example? – Ben L May 13 '16 at 15:02
  • 1
    Possible duplicate of [What is the difference between client-side and server-side programming?](http://stackoverflow.com/questions/13840429/what-is-the-difference-between-client-side-and-server-side-programming) – JJJ May 13 '16 at 15:03

0 Answers0