 <p>PHP is run on a server, Your browser is a client. Once the server sends all the info to the client, nothing can be done on the server until another request is made.</p> <p>To make another request without refreshing the page you are going to have to look into ajax. Look into jQuery as it makes ajax requests easy</p>