php - Whats worng in this code? -
this question has answer here:
- how fix “headers sent” error in php 11 answers
warning: cannot modify header information - headers sent (output started @ c:\xampp\htdocs\needs\home.php:2) in c:\xampp\htdocs\needs\session.php on line 6
session page:
<?php //start session session_start(); //check whether session variable sess_member_id present or not if (!isset($_session['id']) || ($_session['id'] =='')) { header("location: index.php"); exit(); } $session_id=$_session['id']; $user_query = $conn->query("select * members member_id = '$session_id'"); $user_row = $user_query->fetch(); $name = $user_row['firstname']." ".$user_row['middlename']." ".$user_row['lastname']; ?>
it's caused whitespace before opening php tag.
Comments
Post a Comment