added basic php logic for chat