954,132 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Warning: session_start():

  <?php $_SESSION['admfname']= $_POST['fname']; $_SESSION['admlname']= $_POST['lname']; $_SESSION['admpassword']=$_POST['password']; if (($_SESSION['admfname'] == "peter") and ($_SESSION['admlname'] == "gewant") and ($_SESSION['admpassword'] == "approvalagent")) { echo ""; exit; } $f_name= $_POST['fname']; $l_name= $_POST['lname']; $pass= $_POST['password']; if($_POST['submit'] != "Login") { ?> Sign in with your
Account    First Name :   Last Name :   Password :     Forget Password New user click here online.jpg

<?php } elseif($f_name== "" or $l_name== "" or $pass== "") { ?> Sign in with your Account  Please fill all the fields   First Name :   Last Name :   Password :     Forget Password New user click here login1.jpg <?php } else { $query = "SELECT * from helpagent WHERE first='$f_name' and last='$l_name' and password='$pass' "; $result = mysql_query($query); for ($i = 0; $i < mysql_num_rows($result); $i++) { $id = mysql_result($result, $i, "agentid"); $fname = mysql_result($result, $i, "first"); $lname = mysql_result($result, $i, "last"); $pas = mysql_result($result, $i, "password"); if (("$f_name" == "$fname") and ("$l_name" == "$lname") and ("$pass" == "$pas")) { $_SESSION['sfname'] = $f_name; $_SESSION['slname'] = $l_name; $_SESSION['sid'] = $id; echo ""; exit; }//if loop }//for loop echo ""; exit; } ?>    Copyright © 2006 www.bankon.us All Rights Reserved

manish812
Newbie Poster
12 posts since Jun 2006
Reputation Points: 21
Solved Threads: 1
 

HI,

Are you including this file? or is this php script run directly? If you're including, then look into the parent file for the problem.

Are you sure you're updating the file on your remote server, maybe the file is still the old one with the error?

What are you using to edit your php file?

Have you tried editing the file directly on your server? Eg: using a shell access, or some web based control panel (Cpanel/Ensim etc.)

Reason youre getting this error:
sessions are implemented either as cookies or via the url. In your case, cookies, and the session cookie cannot be sent. A cookie is actually a http header.
HTTP headers need to be sent before HTTP Content (PHP output).

So some http content is already being sent somewhere... even though your script looks fine.

digital-ether
Nearly a Posting Virtuoso
Moderator
1,293 posts since Sep 2005
Reputation Points: 461
Solved Threads: 101
 

hi pls help me

this is my main file and i m running it directly
my problem is that i m using window xp and run php & mysql in it thr it run
but whn i run this file in linux server than these problems come
so there will be any problem of that

i have send u full file
i don't know from where some http content is sent

pls help me

manish812
Newbie Poster
12 posts since Jun 2006
Reputation Points: 21
Solved Threads: 1
 

Try removing blank lines from your html. I got this error a while back and this was the solution.

maiahost
Newbie Poster
13 posts since May 2006
Reputation Points: 10
Solved Threads: 1
 

Hi

thank u for u r suggestion i will try it
and thn i will tell u tht it works or not

bye



Try removing blank lines from your html. I got this error a while back and this was the solution.

manish812
Newbie Poster
12 posts since Jun 2006
Reputation Points: 21
Solved Threads: 1
 

Hi

I try wht u do but still i cann't run
this is my main file
and i m using notepad & dreamweaver for editing php

pls help me

i run this prog in my localhost thn it runs
my localhost is window xp
and whn i upload it in linux server thn the error comes

so pls help me

my boss is going 2 kill me if i cann't run this prog.
:sad: :sad: :sad: :sad: :sad: :sad: :sad: :sad: :sad: :sad: :sad:




HI,

Are you including this file? or is this php script run directly? If you're including, then look into the parent file for the problem.

Are you sure you're updating the file on your remote server, maybe the file is still the old one with the error?

What are you using to edit your php file?

Have you tried editing the file directly on your server? Eg: using a shell access, or some web based control panel (Cpanel/Ensim etc.)

Reason youre getting this error:
sessions are implemented either as cookies or via the url. In your case, cookies, and the session cookie cannot be sent. A cookie is actually a http header.
HTTP headers need to be sent before HTTP Content (PHP output).

So some http content is already being sent somewhere... even though your script looks fine.

manish812
Newbie Poster
12 posts since Jun 2006
Reputation Points: 21
Solved Threads: 1
 

Ok...
Try this.

Open your script in notepad. (do not use dreamweaver).
Delete everything before the <?

Make sure <? is right at the top.

Then save the script as plain text. say "file.txt"
Upload it to your sever via ftp, don't use dreamweaver.

In ftp, rename your txt file back to the php extension.

Make sure you are uploading your files as binary. This can be done with most ftp programs.
Usually, if this is a problem with the upload, then the whole file should be "bad". But it just seems that the file on your Linux server, has some text added before the <?. So it could also be the editor, which is dreamweaver, so dont use it.

digital-ether
Nearly a Posting Virtuoso
Moderator
1,293 posts since Sep 2005
Reputation Points: 461
Solved Threads: 101
 

This error comes when u r starting a session after any HTML tags, plz start the session at the veery top of the page

cancer10
Posting Whiz in Training
234 posts since Dec 2004
Reputation Points: 58
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You