Examplel PHP & JavaScript functions