<?php
session_start();
if(!isset($_SESSION['userid']))
{
print '<script type="text/javascript">';
print 'alert("Login to submit resume.")';
print '</script>'; 
header('location:login.html');
}?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

i try every thing still im getting the same problem

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/royal/public_html/submitresume.php:1) in /home/royal/public_html/submitresume.php on line 2

Warning: Cannot modify header information - headers already sent by (output started at /home/royal/public_html/submitresume.php:1) in /home/royal/public_html/submitresume.php on line 8

Every thing working fine on localhost

Recommended Answers

All 11 Replies

Make sure you don't sent anything on browser before you use session_start.
Is there any blank space before code start?

Firstly Thanks for quick reply
@Vibhaj There is no blank space, i post my code from first line of my page
@priaeas how to find non-visible utf8 byte order mark if is there
Im using macromedia dreamweaver8 as a text editor

Try it with a different text-editor, that can enable/disable the mark, or try saving it in Notepad for example.

@pritaeas I try find by using notepad to but did't get any sucess
any more help abt this ..........thanks in advance

Oh wait, overlooked the fact that on line 8 you are trying to redirect, after printing info on the screen. That is not possible. If you really need the alert, do the redirect using javascript, instead of using php's header function.

Actually I insert alert after getting that error that means I tryed by removing that also

Why the code is working is fine on local host but not working on server

Perhaps the warnings are not shown on your local server. Have you tried saving the file in a different texteditor yet?

Can you attach submitresume.php complete file that is uploaded on your live server.

use at the top of your page ob_start() and at the bottom ob_flush()

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.