You count an empty string here: $count = strlen('');
Instead, you need the user input from your form. Show the code of the form.
Something like
$count = strlen($_POST['input_name']);
should work than.
Besides, updating live, while typing, is only possible with client side Javascript.