I have a form with a hidden object:
<input id="tracker" type="hidden" name="tracker" value="0" />
The value is read with JavaScript and increased each time an element is added:
var tracker = document.getElementById("tracker");
var tracked = parseFloat(tracker.value) + 1;
tracker.value = tracked;
This works fine while in HTML and JavaScript, but when I submit the form to PHP the number gets all screwed up:
<form id="uploadForm" action="uploadHandler.php" enctype="multipart/form-data" method="post">
<input id="tracker" type="hidden" name="tracker" value="4" />
$count = $_POST['tracker'];
echo $count;
// 401234
So lets say if the value in the form is 4, then when its echoed from PHP its value is 401234.
Why is it doing this?