second day after php code added for whlie loop