I am trying to add a day to a php date variable every time a button is clicked using javascript onclick(). Below is the code I have so far the only problem is that the first time I click the button, a day gets added to the date, however, any subsequent clicks of the button do nothing.
<?php $depDate = $dep ?>;
function dayBack() {
"<?php echo $depDate = date('Y-m-d', strtotime($depDate. ' + 1 days'))?>";
document.getElementById("hell").innerHTML = "<?php echo $depDate ?>";
}
The variable $dep is already declared earlier in the code and is equal to a date that the user entered in a form.