Hi,
I am trying to use sessions to display information from one page to the next one but I am having the following problems. Could anyone plz help me???????????
Here is my code:

<?php
$pnm1=$_POST;/////////name of text box from previous page


include("db_connect.php");


$sql="SELECT * FROM new_party WHERE party_name='$pnm1'";
$result=mysql_query($sql);


$count=mysql_num_rows($result);


if($count==0){


session_start();
$_session=$pnm1;
.................... and so on

The errors that I am having is as follows:

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at c:\program files\easyphp1-8\www\politics\pro\processregisterparty.php:2) in c:\program files\easyphp1-8\www\politics\pro\processregisterparty.php on line 19


Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at c:\program files\easyphp1-8\www\politics\pro\processregisterparty.php:2) in c:\program files\easyphp1-8\www\politics\pro\processregisterparty.php on line 19

Please I badly need some help. Thank you.

Recommended Answers

All 2 Replies

You can't have an echo, print or any html tag before session_start and header functions. You cannot even have a whitespace.

You have to call session_start() before anything is outputted to the browser. Try calling session_start right after the opening php tags just to make sure.

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.