First of all in on line 12 there is a blank line which should not be there. $ppwd = $_POST['sgp_pwd'];
?>//line 11//
//line 12//
<?php //line13//
if (!empty($pusr) && !empty($ppwd)) {
should be
$ppwd = $_POST['sgp_pwd'];//removed the blank line and ?> and <?php
if (!empty($pusr) && !empty($ppwd)) {
because it would output a empty line which wouldn't allow the setcookie function in validate_login.php