Avatar of doctorbill
doctorbill
Flag for United Kingdom of Great Britain and Northern Ireland asked on

php

When I use the attached "login.php" file I get the following error message:
-------------------------------------
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /web1/user36636/website/site/admin/users.php:2) in /web1/user36636/website/site/admin/login.php on line 15

Warning: Cannot modify header information - headers already sent by (output started at /web1/user36636/website/site/admin/users.php:2) in /web1/user36636/website/site/admin/login.php on line 18
------------------------------------
This page works perfectly on my local system (localhost) but gives this error when the site has been uploaded to a webhosting server

Any ideas?
login.php
PHP

Avatar of undefined
Last Comment
doctorbill

8/22/2022 - Mon
Dave Baldwin

The error is that 'user.php' has already sent output.  You'll have to look at that file to see why.
SOLUTION
Ray Paseur

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
doctorbill

ASKER
I am not at my computer at the moment but I can give you an idea of the workflow:

The user clicks on a page called admin_links.php
this has a php include at the top of the page to check.php
The check.php page checks to see if username and password sessions are set
If not set, there is a redirection to the login page (attached) where username and password are entered
Once the username and password are entered in the login page, the login page redirects to the admin_links.php page again

questions:
1. could it be that the initial reference to the admin_links.php page has caused headers to already be submitted for this page and a later reference to the same page causes the problem
2. why does the page work perfectly on my local system, ?
3. I have already tried putting session_start(); at the top of the page- no difference
Dave Baldwin

Show us the code, then we can tell you.  And we don't know the differences between your 'local system' and your hosted system.  Are they running the same versions of PHP and MySQL?  Are they running the same operating system?
Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER CERTIFIED SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
doctorbill

ASKER
Ray - I take your point.
Is there a download of all the php pages so that I can start working with them?
doctorbill

ASKER
Where can I edit the look of the login page
doctorbill

ASKER
Ray
Disregard my last two comments. I have had a chance to study and implement the files on my test server and all work
I just need to use the access control on a real live page on my ISP site
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
doctorbill

ASKER
This has to be one of the most concise, clear and functional set of web pages and tutorial I have seen - works perfectly !!!!
Thanks so much for this