Jump to content

Trouble accessing MySQL database


laanes

Recommended Posts

The error message:

 

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'swansea3_locktes'@'localhost' (using password: YES) in /home/swansea3/public_html/lock-tech.co.uk/home/scrptz/functions.php on line 25

Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user 'swansea3'@'localhost' (using password: NO) in /home/swansea3/public_html/lock-tech.co.uk/home/scrptz/functions.php on line 26

Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /home/swansea3/public_html/lock-tech.co.uk/home/scrptz/functions.php on line 26

Warning: Cannot modify header information - headers already sent by (output started at /home/swansea3/public_html/lock-tech.co.uk/home/scrptz/functions.php:25) in /home/swansea3/public_html/lock-tech.co.uk/home/scrptz/sessions.php on line 3

Warning: Cannot modify header information - headers already sent by (output started at /home/swansea3/public_html/lock-tech.co.uk/home/scrptz/functions.php:25) in /home/swansea3/public_html/lock-tech.co.uk/home/scrptz/sessions.php on line 4

Warning: Cannot modify header information - headers already sent by (output started at /home/swansea3/public_html/lock-tech.co.uk/home/scrptz/functions.php:25) in /home/swansea3/public_html/lock-tech.co.uk/home/scrptz/sessions.php on line 5

Warning: Cannot modify header information - headers already sent by (output started at /home/swansea3/public_html/lock-tech.co.uk/home/scrptz/functions.php:25) in /home/swansea3/public_html/lock-tech.co.uk/home/scrptz/sessions.php on line 6

Warning: mysql_query() [function.mysql-query]: Access denied for user 'swansea3'@'localhost' (using password: NO) in /home/swansea3/public_html/lock-tech.co.uk/home/scrptz/functions.php on line 203

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/swansea3/public_html/lock-tech.co.uk/home/scrptz/functions.php on line 203
ERROR {2.1a}! Please navigate to a different page and then try this page again.

 

I have tried various sets of user names with various different database names/passwords.

 

The hosting provider says that my connection details are correct and i need to check the configuration in the index.php file. That does not make sense as the website has only been re-hosted, not modified in any way.

 

 

 

Link to comment
Share on other sites

Structure of index.php:

 

<?php 
$hostName="localhost"; 
$dbName="*******"; $pwd="*******"; 
@mysql_connect($hostName, $dbName, $pwd); 
@mysql_select_db($dbName); 

function clean($input, $maxLength){$input=substr(stripslashes(EscapeShellCmd($input)), 0, $maxLength); return $input;}
foreach($HTTP_GET_VARS as $varName=>$value)$getVars[$varName]=trim(clean($value, 100)); 
foreach($HTTP_POST_VARS as $varName=>$value)$postVars[$varName]=trim(clean($value, 100));

?>

 

Is it possible that some of the syntax out of date and is not compatible with the server version?

Link to comment
Share on other sites

I am always logged into phpMyAdmin with one default user.

 

Credentials for each database are set through a database wizard in cPanel but when using phpMyadmin it always shows the default user - defaultuser@localhost, no matter which database is currently being used.

Link to comment
Share on other sites

If any helpful, here is the rest of the code in index.php:

 

<?php $hostName="localhost"; 
$dbName="****"; $pwd="****"; 
@mysql_connect($hostName, $dbName, $pwd); 
@mysql_select_db($dbName); 

function clean($input, $maxLength){$input=substr(stripslashes(EscapeShellCmd($input)), 0, $maxLength); return $input;}
foreach($HTTP_GET_VARS as $varName=>$value)$getVars[$varName]=trim(clean($value, 100)); 
foreach($HTTP_POST_VARS as $varName=>$value)$postVars[$varName]=trim(clean($value, 100));
if($postVars["action"]=="login")
{
if($postVars["usr"] && $postVars["pwd"])
{
	// Get customer details
	if($custDetails=mysql_fetch_array(@mysql_query("SELECT * FROM customers WHERE accCode='".$postVars["usr"]."' and password='".$postVars["pwd"]."'")))
	{
		$securePrefix="https://fusion.bpweb.net/secure/locktech/";
		$navTo=$postVars["goto"]."?uid=".$postVars["uID"];

		// Insert details in session table
		mysql_query("UPDATE sessions SET accCode='".$custDetails["accCode"].
		"', discount='".$custDetails["salesInd3"].
		"', buyAlert='".$custDetails["buyAlert"].
		"', stockAlert='".$custDetails["stockAlert"].
		"', vat='".$custDetails["vat"].
		"' WHERE uid='".$postVars["uID"]."' LIMIT 1")
		or $navTo="login.php?uid=".$postVars["uID"]."&logError=true";
	}
	else
	{
		unset($securePrefix);
		$navTo="login.php?uid=".$postVars["uID"]."&logError=true";
	}
}
}
elseif($postVars["killSession"]){@mysql_query("DELETE FROM sessions WHERE uid='".$postVars["killSession"]."' AND accCode='".$postVars["account"]."' LIMIT 1"); $navTo="main.php";}
elseif($getVars["myURL"])
{
if(strpos($getVars["myURL"], "account")===false && strpos($getVars["myURL"], "basket")===false &&	strpos($getVars["myURL"], "checkout")===false &&
strpos($getVars["myURL"], "confirm")===false && strpos($getVars["myURL"], "goto")===false && strpos($getVars["myURL"], "vat")===false &&
strpos($getVars["myURL"], "PCode")===false && strpos($getVars["myURL"], "qty")===false && strpos($getVars["myURL"], "orders")===false && strpos($getVars["myURL"], "chpwd")===false &&
strpos($getVars["myURL"], "price")===false && strpos($getVars["myURL"], "UPDATE")===false && strpos($getVars["myURL"], "DELETE")===false &&
strpos($getVars["myURL"], "myURL")===false && strpos($getVars["myURL"], "uid")===false && strpos($getVars["myURL"], "action")===false)
{
	$navTo=$getVars["myURL"];
	foreach($getVars as $varName=>$value)if($varName!="myURL" && $varName!="goto" && $varName!="vat" && $varName!="PCode" && $varName!="qty" &&
	$varName!="price" && $varName!="UPDATE_x" && $varName!="DELETE_x" && $varName!="uid" && $varName!="action")$navTo.="&".$varName."=".$value;
}
else{$navTo="main.php"; unset($securePrefix);}
}
else{$navTo="main.php"; unset($securePrefix);} ?>

Link to comment
Share on other sites

@mysql_connect($hostName, $dbName, $pwd);

@mysql_select_db($dbName);

 

^^^ If that's your real code, take a look at it. You are using $dbName as the mysql username (2nd parameter in the mysql_connect.) Edit: And I'm going to guess that if you had actually read the mysql_connect() error message, you would have noticed that the user it mentions is actually your database name? You are the only one here who knows what your actual information is and can interpret what the error message means relative to what you are doing.

 

And I'm guessing that the @'s in the code were just put there by you due to the error messages?

 

Hiding the errors won't make your code work. It still won't work AND there won't be any error messages to tell you why it is not working.

Link to comment
Share on other sites

You are the only one here who knows what your actual information is and can interpret what the error message means relative to what you are doing.

 

$hostName="localhost";

$dbUser="swansea3_lockT";

$dbName="swansea3_locktest";

 

 

And I'm guessing that the @'s in the code were just put there by you due to the error messages?

 

Hiding the errors won't make your code work. It still won't work AND there won't be any error messages to tell you why it is not working.

 

Code has not been written by me, if it would, i would not be asking questions here.

 

I have removed the @'s and changed the parameters in mysql_connect:

 

$hostName="localhost"; 
$dbName="swansea3_locktest"; 
$dbUser="swansea3_lockT";
$pwd="******"; 
mysql_connect($hostName, $dbUser, $pwd); 
mysql_select_db($dbName); 

 

Error message does not change.

 

I don't get why the error message is saying Access denied for user 'swansea3'@'localhost as I have not swansea3 to be a user for that database.

 

swansea3 is the default username given you when creating an account with the hosting provider and is also the database prefix.

Link to comment
Share on other sites

There's no way the code you have been posting with the @'s in it could have been outputting the posted errors. You must have some other code at the file/line number being reported in the errors.

 

Only the first error is relevant to this problem. The other errors are follow-on errors caused because the mysql_connect() is failing.

Link to comment
Share on other sites

There's no way the code you have been posting with the @'s in it could have been outputting the posted errors. You must have some other code at the file/line number being reported in the errors.

 

Only the first error is relevant to this problem. The other errors are follow-on errors caused because the mysql_connect() is failing.

 

So most definately some of the credentials must be wrong?

Link to comment
Share on other sites

/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*)."'")
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');

 

 

 

Link to comment
Share on other sites

The current symptom means that the query failed due to an error (I'm going to guess a problem with the table name or the column name or permissions or the database...)

 

For debugging purposes (restore the code to what it currently is now when you are done), change the or die(.....) to

 

or die(mysql_error());

 

P.S. Are you sure this code worked before it was moved to the current server? All the @'s tell me that whoever wrote this was in favor of hiding problems in the code rather than finding and fixing them. For example, @set_time_limit(3); won't ever produce an error unless that function has been disabled on the server (which is highly unlikely), but you would want to know if that was the case and you would want to have that error reported.

Link to comment
Share on other sites

I have now added -

or die(mysql_error());

to every function that used to have -

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>");

instead.

 

I have also tried to add a comment to every function to help myself to understand what each of them means. It is possible that I have misunderstood some of them in which case the comments would not be very helful.

 

function inDaList($addy)
{
$result=@mysql_query("SELECT email FROM mailinglist") or die(mysql_error());
while($row=@mysql_fetch_array($result))foreach($row as $data)$addyArray[]=strtoupper($data);

return in_array($addy, $addyArray);
}

// Session functions
function startSession()
{
// Read all sessionIDs from session table
$result=mysql_query("SELECT uid FROM sessions")
or die(mysql_error());

// Stick them in an array
while($row=mysql_fetch_array($result))foreach($row as $data)$sArray[]=$data;

// Read all sessionIDs from basket table
$result=mysql_query("SELECT sessionID FROM basket")
    or die(mysql_error());
// Stick them in an array
while($row=mysql_fetch_array($result))foreach($row as $data)$bArray[]=$data;

// Generate random id string
srand((float)microtime()*100000000);
$theID=md5(rand());

// Make sure that the id is unique
if(!count($sArray))$sArray=array();
if(!count($bArray))$bArray=array();
while(in_array($theID, $sArray) || in_array($theID, $bArray))$theID=md5(rand());

// Insert values in db
mysql_query("INSERT INTO sessions SET uid='".$theID."',theTime='".time()."'")
or die(mysql_error());

// Add sessionid to Getvars array
global $getVars;
$getVars["uid"]=$theID;
}

function destroySession($ID)
{
global $getVars, $sessions;
mysql_query("DELETE FROM sessions WHERE ID='".$ID."' LIMIT 1")
or die(mysql_error());

// 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*)."'")
or die(mysql_error());

// Stick session variables into an array
while($row=mysql_fetch_array($result))foreach($row as $i=>$data)$sessions[$i]=$data;

// Update session with current time
mysql_query("UPDATE sessions SET theTime='".time()."' WHERE ID='".$sessions["uid"]."' LIMIT 1")
or die(mysql_error());
}

function updateSession($ID, $var, $value)
{
global $getVars, $sessions;

// Update requested variable in session table
mysql_query("UPDATE sessions SET ".$var."='".$value."' WHERE ID='".$ID."' LIMIT 1")
or die(mysql_error());

readSessionVars($getVars["uid"]);
}

 

Link to comment
Share on other sites

I have now added -

or die(mysql_error());

to every function that used to have -

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>");

instead.

 

I have also tried to add a comment to every function to help myself to understand what each of them means. It is possible that I have misunderstood some of them in which case the comments would not be very helful.

 

function inDaList($addy)
{
$result=@mysql_query("SELECT email FROM mailinglist") or die(mysql_error());
while($row=@mysql_fetch_array($result))foreach($row as $data)$addyArray[]=strtoupper($data);

return in_array($addy, $addyArray);
}

// Session functions
function startSession()
{
// Read all sessionIDs from session table
$result=mysql_query("SELECT uid FROM sessions")
or die(mysql_error());

// Stick them in an array
while($row=mysql_fetch_array($result))foreach($row as $data)$sArray[]=$data;

// Read all sessionIDs from basket table
$result=mysql_query("SELECT sessionID FROM basket")
    or die(mysql_error());
// Stick them in an array
while($row=mysql_fetch_array($result))foreach($row as $data)$bArray[]=$data;

// Generate random id string
srand((float)microtime()*100000000);
$theID=md5(rand());

// Make sure that the id is unique
if(!count($sArray))$sArray=array();
if(!count($bArray))$bArray=array();
while(in_array($theID, $sArray) || in_array($theID, $bArray))$theID=md5(rand());

// Insert values in db
mysql_query("INSERT INTO sessions SET uid='".$theID."',theTime='".time()."'")
or die(mysql_error());

// Add sessionid to Getvars array
global $getVars;
$getVars["uid"]=$theID;
}

function destroySession($ID)
{
global $getVars, $sessions;
mysql_query("DELETE FROM sessions WHERE ID='".$ID."' LIMIT 1")
or die(mysql_error());

// 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*)."'")
or die(mysql_error());

// Stick session variables into an array
while($row=mysql_fetch_array($result))foreach($row as $i=>$data)$sessions[$i]=$data;

// Update session with current time
mysql_query("UPDATE sessions SET theTime='".time()."' WHERE ID='".$sessions["uid"]."' LIMIT 1")
or die(mysql_error());
}

function updateSession($ID, $var, $value)
{
global $getVars, $sessions;

// Update requested variable in session table
mysql_query("UPDATE sessions SET ".$var."='".$value."' WHERE ID='".$ID."' LIMIT 1")
or die(mysql_error());

readSessionVars($getVars["uid"]);
}

 

And there we are:

 

Table 'swansea3_locktech.sessions' doesn't exist

 

I guess the next thing now is to find out where is the correct sql file located as the one i imported does not have all the tables needed and can not therefore be the right one.

 

Re-hosting a website which isn't developed by yourself and is without any documentation seems to be a whole lot of fun.

Link to comment
Share on other sites

After re-importing the database with the missing sessions table, the website came up, hurray! But with missing features - can not get the products from the database.

 

No Products Found.

Sorry, but there are no products in this section at the moment. The products are constantly being updated, however. Please try again later or contact us.

 

I found this line in a file is called groups.php

 

<td height="416" valign="top" class="mainbold"><?php if($totalGroups>0){?><img src="grp_pics/<?php echo $groupDetails["PG"] ?>.jpg" alt="Group Picture" galleryimg="no"><br><img src="imgz/pixel.gif" width="306" height="5"><br> <?php echo $groupDetails["GPText"] ?><?php }else{?><p class="noresult">No Products Found.</p><p class="mainbold">Sorry, but there are no products in this section at the moment. The products are constantly being updated, however. Please try again later or <a href="mailto:sales@lock-tech.co.uk" class="link1" onmouseover="window.status='Send us an Email.'; return true">contact us</a>.</p><?php }?></td>

 

What is that telling me?

 

Would there be a way of adding an or die element into that line instead of that please try again later message?

Link to comment
Share on other sites

Or,

 

it fails before it even gets to that line - when trying to select second level sub groups in the database?

 

groups.php:

 

<?php
include 'scrptz/functions.php';

// Page vars
$thisPage=$getVars["page"];
if($thisPage<1)$thisPage=1;
$firstGroup=($thisPage*16)-16;

// Get group details and stick them into an array
$qMain="SELECT * FROM PGroups WHERE PG = '".$getVars["prodg"]."'";
$result=mysql_query($qMain)
or die("<font color=\"#FF0000\">ERROR {9.1}! Please navigate to a <a href=\"main.php?uid=".$getVars['uid']."\">different page</a> and then try this page again.</font>");
$groupDetails=mysql_fetch_array($result);

// Get all sub groups in current product group
$qMain="SELECT * FROM SubG WHERE ProdG = '".$getVars["prodg"]."'";
$result=mysql_query($qMain)
or die("<font color=\"#FF0000\">ERROR {9.2}! Please navigate to a <a href=\"main.php?uid=".$getVars['uid']."\">different page</a> and then try this page again.</font>");

// Stick sub groups in a 2D associative array
$j=0;
while ($row=mysql_fetch_array($result))
{
foreach($row as $i=>$data)$array[$j][$i]=$data;
$j++;
}

// Calculate vars for navigation
$totalGroups=$j;
$totalPages=ceil($totalGroups/16);

// Set page title (for bookmark)
$pageTitle=$groupDetails["GPname"];

// Set top title
if($totalGroups>0){$topTitle="VIEW PRODUCTS";}else{$topTitle="ERROR";}
?>
<html>
<head>
<script language="JavaScript" type="text/javascript">var theID="<?php echo $getVars['uid']; ?>";</script>
<script language="JavaScript" src="scrptz/content.js" type="text/javascript"></script>
<script language="JavaScript" src="scrptz/menu.js" type="text/javascript"></script>
<script language="JavaScript" src="scrptz/scripts.js" type="text/javascript"></script>
</head>
<body background="imgz/bg.gif" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0"<?php echo $notify ?>>
<?php include("top.php"); ?>
<table width="952" height="509" border="0" cellpadding="0" cellspacing="0" class="maintext">
<?php if($sessions['accCode']){?><form action="http://www.lock-tech.co.uk/index.php" method="post" name="logout" target="_parent"><input name="account" type="hidden" value="<?php echo $sessions['accCode']; ?>"><input name="killSession" type="hidden" value="<?php echo $getVars['uid']; ?>"></form><?php }?>
  <tr> 
    <td width="1" rowspan="5" bgcolor="#000000"></td>
    <td height="21" background="imgz/topbar.gif" bgcolor="#14359E"> </td>
    <td height="21" colspan="5" valign="middle" background="imgz/topbar.gif" bgcolor="#14359E" class="mainyellow"><?php include("scrptz/dd_menu.php"); ?></td>
    <td height="21" background="imgz/topbar.gif" bgcolor="#14359E"> </td>
    <td width="1" rowspan="5" bgcolor="#000000"></td>
  </tr>
  <tr> 
    <td width="5" rowspan="3"> </td>
    <td width="306" height="30" valign="bottom" class="title2"><?php echo $groupDetails["GPname"] ?></td>
    <td width="11" rowspan="3"><img src="imgz/maindiv.gif" width="11" height="466"></td>
    <td width="306" height="30" align="center" valign="bottom" class="title2"><?php if($totalGroups>0){?><a href="g_view.php?pgroup=<?php echo $groupDetails["PG"] ?>&uid=<?php echo $getVars['uid']; ?>" class="link4" onmouseover="window.status='View List of all Products in <?php echo $groupDetails["GPname"] ?>'; return true">VIEW ALL</a> | <a href="g_browse.php?pgroup=<?php echo $groupDetails["PG"] ?>&uid=<?php echo $getVars['uid']; ?>" class="link4" onmouseover="window.status='Browse all Products in <?php echo $groupDetails["GPname"] ?>'; return true">BROWSE ALL</a><?php }?></td>
    <td width="11" rowspan="3"><img src="imgz/maindiv.gif" width="11" height="466"></td>
    <td width="306" height="30" align="center" valign="bottom"> </td>
    <td width="5" rowspan="3"> </td>
  </tr>
  <tr> 
    <td height="20" valign="top" class="mainbold"></td>
    <td width="306" rowspan="2" valign="top" class="maintext">
      <?php for($i=$firstGroup; $i<($firstGroup+ && $i<$totalGroups; $i++){?>
      <a href="sub.php?PSubG=<?php echo $array[$i]["SPG"] ?>&uid=<?php echo $getVars['uid']; ?>" class="link1" onmouseover="window.status='View Products in <?php echo $array[$i]["SPGname"] ?>'; return true"><?php echo $array[$i]["SPGname"] ?></a><br>
		<?php
		// Get all subsubs in current sub group
		$qMain="SELECT * FROM SubSubG WHERE SPG = '".$array[$i]["SPG"]."'";
		$result=mysql_query($qMain)
		or die("<font color=\"#FF0000\">ERROR {9.3}! Please navigate to a <a href=\"main.php?uid=".$getVars['uid']."\">different page</a> and then try this page again.</font>");

		// Print subsubs
		while ($row=mysql_fetch_array($result))
		{
		?>
			[<a href="subsub.php?PSubSubG=<?php echo $row["SSPG"]?>&uid=<?php echo $getVars['uid']; ?>" class="link3" onmouseover="window.status='View Products in <?php echo $row["SSPGName"]?>'; return true"><?php echo $row["SSPGName"]?></a>] 
		<?php
		}
		?>
		<br><br>
		<?php }?></td>
    <td width="306" rowspan="2" valign="top" class="maintext">
      <?php for($i=$firstGroup+8; $i<($firstGroup+16) && $i<$totalGroups; $i++){?>
      <a href="sub.php?PSubG=<?php echo $array[$i]["SPG"] ?>&uid=<?php echo $getVars['uid']; ?>" class="link1" onmouseover="window.status='View Products in <?php echo $array[$i]["SPGname"] ?>'; return true"><?php echo $array[$i]["SPGname"] ?></a><br>
		<?php
		// Get all subsubs in current sub group
		$qMain="SELECT * FROM SubSubG WHERE SPG = '".$array[$i]["SPG"]."'";
		$result=mysql_query($qMain)
		or die("<font color=\"#FF0000\">ERROR {9.4}! Please navigate to a <a href=\"main.php?uid=".$getVars['uid']."\">different page</a> and then try this page again.</font>");

		// Print subsubs
		while ($row=mysql_fetch_array($result))
		{
		?>
			[<a href="subsub.php?PSubSubG=<?php echo $row["SSPG"]?>&uid=<?php echo $getVars['uid']; ?>" class="link3" onmouseover="window.status='View Products in <?php echo $row["SSPGName"]?>'; return true"><?php echo $row["SSPGName"]?></a>] 
		<?php
		}
		?>
		<br><br>
<?php }?></td>
  </tr>
  <tr> 
    <td height="416" valign="top" class="mainbold"><?php if($totalGroups>0){?><img src="grp_pics/<?php echo $groupDetails["PG"] ?>.jpg" alt="Group Picture" galleryimg="no"><br><img src="imgz/pixel.gif" width="306" height="5"><br> <?php echo $groupDetails["GPText"] ?><?php }else{?><p class="noresult">No Products Found.</p><p class="mainbold">Sorry, but there are no products in this section at the moment. The products are constantly being updated, however. Please try again later or <a href="mailto:sales@lock-tech.co.uk" class="link1" onmouseover="window.status='Send us an Email.'; return true">contact us</a>.</p><?php }?></td>
  </tr>
  <tr> 
    <td width="5" height="22" background="imgz/btmbar.gif" bgcolor="#14359E"> </td>
    <td width="306" height="22" align="center" valign="top" background="imgz/btmbar.gif" bgcolor="#14359E"><a href="javascript:history.back()" onmouseover="prev_btn.src='imgz/prev2.gif';window.status='Previous Page'; return true" onmouseout="prev_btn.src='imgz/prev.gif'"><img name="prev_btn" src="imgz/prev.gif" width="124" height="16" border="0"></a></td>
    <td width="11" height="22" bgcolor="#14359E"><img src="imgz/btmdiv.gif" width="11" height="22"></td>
    <td width="306" height="22" align="center" background="imgz/btmbar.gif" bgcolor="#14359E" class="nav"><? include 'scrptz/nav.php' ?></td>
    <td width="11" height="22" bgcolor="#14359E"><img src="imgz/btmdiv.gif" width="11" height="22"></td>
    <td width="306" height="22" align="center" valign="top" background="imgz/btmbar.gif" bgcolor="#14359E"><a href="javascript:directLink('<?php echo $prodLink; ?>','<? echo $pageTitle ?>')" onmouseover="link_btn.src='imgz/link2.gif'; window.status='Direct Link to This Page'; return true" onmouseout="link_btn.src='imgz/link.gif'"><img name="link_btn" src="imgz/link.gif" alt="" width="182" height="16" border="0"></a></td>
    <td width="5" height="22" background="imgz/btmbar.gif" bgcolor="#14359E"> </td>
  </tr>
</table>
</body>
</html>

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.