OK, some errors! (I set error reporting on)
Notice: Undefined variable: link in C:\phpWeb\Right-Track\includes\dbconn.inc on line 2
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\phpWeb\Right-Track\includes\dbconn.inc:2) in C:\phpWeb\Right-Track\includes\funclib.inc on line 3
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\phpWeb\Right-Track\includes\dbconn.inc:2) in C:\phpWeb\Right-Track\includes\funclib.inc on line 3
Warning: Cannot modify header information - headers already sent by (output started at C:\phpWeb\Right-Track\includes\dbconn.inc:2) in C:\phpWeb\Right-Track\includes\funclib.inc on line 4
Just so you can see, my 2 include files:
funclib.inc
PHP Code:
<?php
session_start();
header('Cache-Control: public');
function cleanMemberSession($id, $login, $pass)
{
$_SESSION[id] = $id;
$_SESSION[login] = $login;
$_SESSION[password] = $pass;
$_SESSION[logged_in] = true;
}
?>
dbconn.inc
PHP Code:
<?php
$link;
connectToDB();
function connectToDB()
{
global $link;
$link = mysql_connect("localhost","root","quiksilver");
if(!$link)
die("Could not connect to MySQL");
mysql_select_db("righttrack", $link);
}
function newUser($login, $pass)
{
global $link;
$result=mysql_query("insert into user_details (username, password)
values('$login', '$pass')", $link);
return mysql_insert_id($link);
}
function getRow($table, $fnm, $fval)
{
global $link;
$result=mysql_query("select * from $table where $fnm='$fval'", $link);
if(!$result)
die("getRow fatal error: " .mysql_error());
return mysql_fetch_array($result);
}
?>
Not sure what all this means. I've probably messed up big time, but any advice appreciated.
Thanks.
Bookmarks