Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7598081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:19:09+00:00 2026-05-30T22:19:09+00:00

i am beginner in php i search for hours and try everthing that i

  • 0

i am beginner in php i search for hours and try everthing that i can but still getting this error.
Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at /home/apsterne/public_html/mag/main.php:1) in /home/apsterne/public_html/mag/includes/functions.php on line 3

this is my login page where i’m logging in and going for main page

include_once('includes/functions.php');
include_once('includes/connection.php');
if(loggedin())
{
    header("location:main.php");
     exit();
}
if (isset($_POST['submit'])){
$error=array();
if($_POST['username']=="") $error[]='Please Enter Username'; 
if($_POST['password']=="") $error[]='Please Enter Password';
if(isset($_GET['e'])) $error[]='You Are Trying to access secure page without login';
if(isset($_POST['rememberme'])) $remember=$_POST['rememberme'];
function cleanStr($str) {
        $cStr = trim($str);
        $cStr = htmlspecialchars($cStr);
        $cStr = addslashes($cStr);
        return $cStr;
    }
        $userName = cleanStr($_POST['username']);
        $pwd = cleanStr($_POST['password']);


$result=mysql_query("SELECT * FROM login WHERE username = '$_POST[username]'");
$row=mysql_fetch_array($result);
if(empty($error)){
                if($userName==$row['username'] && $pwd==$row['password'] ){ 
                    if($rememberme=="on")        
                          setcookie("username",$userName,time()+7200);
                   else if($rememberme==""){
                                    $_SESSION['username']=$userName;
                                    header("location:main.php");
                                    exit();
                                    }
                            }
                            else
                            $error[]='You Enter Wrong username and password';

            }
}

THis is main page

<?php
include_once('includes/functions.php');
include_once('includes/connection.php');
if(!loggedin())
{
    header("location:index.php");
    exit();
}
?>

And This is Function File

<?php
session_start();
function loggedin()
{
    if(isset($_SESSION['username']) || isset ($_COOKIE['username']))
        {
         $loggedin=TRUE;
         return TRUE ;
        }
}
?>

There is no whitespace and i dont know what is this..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T22:19:11+00:00Added an answer on May 30, 2026 at 10:19 pm

    I think you have a blank line in one or more of your files or you saved some of them with UTF-8 encoding + bite order mark bytes. Try to save them with UTF-8 without BOM.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a topic that, as a beginner to PHP and programming, sort of
I am a beginner in PHP and am working on a script that can
This is probably pretty basic, but I'm a beginner in PHP - I have
I am a PHP beginner and saw on the forum this PHP expression: My
I am beginner in PHP. I am trying to parse this xml file. <relationship>
I am a beginner to ruby on rails.But i am quite comfortable with php,
I'm a beginner at PHP, and I'm still trying to work out proper file
I am beginner in PHP and i read in manual that $_REQUEST is a
I am a beginner in PHP. How can I restrict user access to controller.php
im a beginner in using solr. i know that you can either use ajax

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.