/home/scrptz/functions.php on line 25
For anyone here to directly be able to help, it would take seeing what lines 1 - 25 of that file is.
<?php
define("VAT", 17.5);
define("JIFFY", 5);
define("HTMLSIGNATURE", "<br><br><br><br><br><br>LOCK-TECH® a division of<br>Swansea Timber & Ply Co. Ltd.<br>57-60 Oxford Street, Swansea SA1 3JD<br><br>[t] 01792 655680 [f] 01792 462243<br>[e] <a href=\"mailto:sales@lock-tech.co.uk\">sales@lock-tech.co.uk</a> [w] <a href=\"http://www.lock-tech.co.uk\">www.lock-tech.co.uk</a>");
define("TEXTSIGNATURE", "\n\n\n\n\n\nLOCK-TECH� a division of\nSwansea Timber & Ply Co. Ltd.\n57-60 Oxford Street, Swansea SA1 3JD\n\n[t] 01792 655680 [f] 01792 462243\n[e] sales@lock-tech.co.uk [w] www.lock-tech.co.uk");
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
$bArray=array();
$sessions=array();
@set_time_limit(3);
// Database vars
$hostName="localhost";
$dbUser="swansea3_lockT";
$dbName="swansea3_locktech";
$pwd="****";
$qMain="SELECT * FROM pDetails
INNER JOIN products ON (pDetails.code = products.SCode)
INNER JOIN PRanges ON (products.PRange = PRanges.RangeID)
INNER JOIN PGroups ON (products.PGroup = PGroups.PG)
INNER JOIN SubG ON (products.PSubG = SubG.SPG)
INNER JOIN SubSubG ON (products.SSPG = SubSubG.SSPG) ";
mysql_connect($hostName, $dbUser, $dbName, $pwd); <------- LINE 25
mysql_select_db($dbName);Ok, now when you pointed where to look, I can see that there is one too many variables listed in the MySQL connection. No need to have dbname in there.
However, when I remove it, a whole new error message is being displayed:
ERROR {2.1a}! Please navigate to a different page and then try this page again.
I can see that this is an "or die" message added to every function in functions.php file.
functions with this output in functions.php:
function inDaList($addy)
{
$result=@mysql_query("SELECT email FROM mailinglist") or die("<font color=\"#FF0000\">ERROR {2.0a}! Please navigate to a <a href=\"main.php?uid=".$sessions['uid']."\">different page</a> and then try this page again.</font>");
while($row=@mysql_fetch_array($result))foreach($row as $data)$addyArray[]=strtoupper($data);
return in_array($addy, $addyArray);
}
// Session functions
function startSession()
{
$result=mysql_query("SELECT uid FROM sessions")
or die("<font color=\"#FF0000\">ERROR {2.1a}! Please navigate to a <a href=\"main.php?uid=".$sessions['uid']."\">different page</a> and then try this page again.</font>");
while($row=mysql_fetch_array($result))foreach($row as $data)$sArray[]=$data;
$result=mysql_query("SELECT sessionID FROM basket")
or die("<font color=\"#FF0000\">ERROR {2.1b}! Please navigate to a <a href=\"main.php?uid=".$sessions['uid']."\">different page</a> and then try this page again.</font>");
while($row=mysql_fetch_array($result))foreach($row as $data)$bArray[]=$data;
srand((float)microtime()*100000000);
$theID=md5(rand());
if(!count($sArray))$sArray=array();
if(!count($bArray))$bArray=array();
while(in_array($theID, $sArray) || in_array($theID, $bArray))$theID=md5(rand());
mysql_query("INSERT INTO sessions SET uid='".$theID."',theTime='".time()."'")
or die("<font color=\"#FF0000\">ERROR {2.2}! Please navigate to a <a href=\"main.php\">different page</a> and then try this page again.</font>");
global $getVars;
$getVars["uid"]=$theID;
}
function destroySession($ID)
{
global $getVars, $sessions;
mysql_query("DELETE FROM sessions WHERE ID='".$ID."' LIMIT 1")
or die("<font color=\"#FF0000\">ERROR {2.3}! Please navigate to a <a href=\"main.php?uid=".$sessions['uid']."\">different page</a> and then try this page again.</font>");
// Remove session ID from getVars
unset($getVars['uid']);
}
function readSessionVars($ID)
{
global $getVars, $sessions;
$result=mysql_query("SELECT * FROM sessions WHERE uid='".$ID."' AND theTime>='".(time()-(3600*8))."'")
or die("<font color=\"#FF0000\">ERROR {2.4}! Please navigate to a <a href=\"main.php?uid=".$sessions['uid']."\">different page</a> and then try this page again.</font>");
while($row=mysql_fetch_array($result))foreach($row as $i=>$data)$sessions[$i]=$data;
mysql_query("UPDATE sessions SET theTime='".time()."' WHERE ID='".$sessions["uid"]."' LIMIT 1")
or die("<font color=\"#FF0000\">ERROR {2.5}! Please navigate to a <a href=\"main.php?uid=".$sessions['uid']."\">different page</a> and then try this page again.</font>");
}
function updateSession($ID, $var, $value)
{
global $getVars, $sessions;
mysql_query("UPDATE sessions SET ".$var."='".$value."' WHERE ID='".$ID."' LIMIT 1")
or die("<font color=\"#FF0000\">ERROR {2.6}! Please navigate to a <a href=\"main.php?uid=".$sessions['uid']."\">different page</a> and then try this page again.</font>");
readSessionVars($getVars["uid"]);
}
include('efunctions.php');
include('sessions.php');