I am getting the following error code:
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /srv/disk1/1365341/www/pokeronline.atspace.eu/tables/NewTable.php:1) in /srv/disk1/1365341/www/pokeronline.atspace.eu/tables/NewTable.php on line 2
session_start()
is the very first thing in my file.
I can't find a solution to it, I already spent like 3 hours trying to figure it out.
<?php
session_start();
require 'config.php';
?>
<?php
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="cache-control" content="no-cache" />
<title>NewTable</title>
<style type="text/css">
</style></head>
<body>
</body>
</html>
Config.php
<?php
/**
* Config and making connection
*/
$cfg['db_server'] = 'xxx'; // db server
$cfg['db_user'] = 'xxx'; // user name
$cfg['db_pass'] = 'xxx'; // pass
$cfg['db_name'] = 'xxx'; // DB name
//connect to database
$conn = @mysql_connect ($cfg['db_server'], $cfg['db_user'], $cfg['db_pass']);
$select = @mysql_select_db ($cfg['db_name'], $conn);
if (!$conn) {
die ('<p class="error">Unable o connect to the database</p>');
}
if (!$select) {
die ('<p class="error">Unable o connect to the database</p>');
Can somebody help?
@EDIT: FIXED.I created another php file, opened it in a different editor ( Adobe Dreamweaver in my case) and saved the file again. Before I used "all types" and wrote NewTable.php . Now I used php files from the list, and unchecked the include BOM tick box. Works perfectly now. Thank you all for time taken to help and I really appreciate it.
Unable o connect to the database
'); – pokrak94 Apr 26 '14 at 15:07