Search
Left Quote    I have not failed. I've just found 10,000 ways that won't work.
- Thomas Alva Edison    
Right Quote
 
[login] | [Register]
Forum Index » PHP and mySQL » Viewing Topic and Replies
Post Reply


        Viewing Topic: session_start() ; problems.. please help
  This user is online  Guest
  Subject: "session_start() ; problems.. please..." Posted: @ 5:13 pm on Jul 14 2006   
Unregistered
have a look at these warnings:

Code:

Warning: session_start() : Cannot send session cookie - headers already sent by (output started at /home/spillet/w ww/header.php:9 ) in /home/spillet/w ww/header.php on line 10

Warning: session_start() : Cannot send session cache limiter - headers already sent (output started at /home/spillet/w ww/header.php:9 ) in /home/spillet/w ww/header.php on line 10

Warning: main(): open_basedir restriction in effect. File(/var/www/d b_connect.php) is not within the allowed path(s): (/home:/tmp:/va r/lib/php4/) in /home/spillet/w ww/header.php on line 11

Warning: main(/var/www/d b_connect.php): failed to open stream: Operation not permitted in /home/spillet/w ww/header.php on line 11

Fatal error: main(): Failed opening required '/var/www/db_co nnect.php' (include_path=' .:/usr/share/ph p:/usr/share/pe ar') in /home/spillet/w ww/header.php on line 11



here is the code that made the warnings:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//D TD HTML 4.01 Transitional//E N">

<html>
<head>
<link rel="style sheet" type="text /css" media="all " href="defa ult.css" />
<meta http-equiv=&quo t;Content-Type& quot; content="t ext/html" charset=iso-885 9-1" />
<title>Sp illet</title >

<? ob_start();
session_start() ;
require_once($_ SERVER['DOCUMEN T_ROOT'].'/db_c onnect.php');

if(!isset($_SES SION['username' ]) && !isset($_SESSIO N['password'])) {
$_SESSION['logg ed_in'] = 0;
$user = "Guest&quo t;;
header("Lo cation: http://spillet. php1h.com"< img src=/forums/ima ges/smilies/win k.gif border=0>;
}
?>

</head> <body>



I have searched the forums for a solution already but i cant find anything relavant. the only thing i could think of was is ob_start(); but i have already added it... :S

i dont know what is causing these warnings. please help me.

thanks

    Viewed: 5,414 Times | Reply to This | To top
  This user is online  Guest
  Subject: "re: session_start() ; problems.. pl..." Posted: @ 5:25 pm on Jul 14 2006    
Unregistered

here is the code for db_connect.php:



Code:

<?php

$database[dbser ver]="*** ******";< br /> $database[dbuse r]="***** ****";
$database[dbnam e]="***** *****"; $database[dbpas s]="***** *********" ;;
$table ="members ";

$connect = mysql_connect($ database['dbse rver'], $database['dbu ser'], $database['dbp ass']);

$select= mysql_select_db ($database['db name']);
?>



i blotted out the username and password etc



    Viewed: 5,406 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: session_start() ; problems.. pl..." Posted: @ 5:54 pm on Jul 14 2006    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

on your 2nd code sample show, you're using ob_start(); incorrectly. PUT: <? ob_start(); ?>

before: <!DOCTYPE HTML PUBLIC "-//W3C// DTD HTML 4.01 Transitional//E N">

and delete the ob_start you have just above session_start.




-bs0d | AllSyntax.com

    Viewed: 5,398 Times | Reply to This | To top
Viewing Page: 1 of 1


1 |

You must be logged in to post on the forums. Login or Register








"AllSyntax.com" Copyright © 2002-2018; All rights lefted, all lefts righted.
Privacy Policy  |  Internet Rank