I have this PHP code :
<?php
if(isset($_POST['go'])){
echo 'the array contains' . $_COOKIE['arrayCount'] . 'values';
}
?>
<form method='POST'>;
<?php
$arr = array(//some dynamic values);
setcookie('arrayCount' , count($arr));
?>
<input type='submit' name='go' />
</form>
for example if the count of the value in the array is '10' , and the previous count was '15' , I get the '15' printed with the message: 'the array contains 15 values'
I want to print the message at the top of the page , Is it possible to be done this way or I would need to use Ajax or re arrange the code?