Sample php and javascript code