This thing is still returning error!! ): I tried it as you said on it's own and here in context.
Parse error: syntax error, unexpected T_STRING in /home/biomagn1/public_html/recommendingpeople.com/profilesummary.php on line 16
Code: Select all
<?php
session_start();
// Do your includes here
require_once('Connections/recommendingpeople.php');
$username = $_SESSION['MM_Username'];
// This is the query using the string stored in the variable $username
$query= "SELECT userid FROM rsusername WHERE username='$username';";
$result = mysql_query($query);
// this counts the rows, false if none
$numRows = mysql_num_rows($result);
// run if statements to check we have stuff retrieved in the query, we echo the id if it is found or a string if
// either it isn't or many users are found
if ($numRows) {
if ($numRows == 1) {
// create an array containing the result of the mysql query result
$array = mysql_fetch_array($result, MYSQL_ASSOC);
// retrieve the userid from the array of the mysql query result
$userid = $array['userid'];
// assign the userid to the session variable
$_SESSION['userid'] = $userid;
// echo the session variable 'userid' for debugging purposes, you'll want to delete this eventually
echo $_SESSION['userid'];
} elseif ($numRows > 1) {
// echo for debugging purposes, you'll want to delete this eventually
echo "Lots of rows were returned";
} else {
// echo for debugging purposes, you'll want to delete this eventually
echo "No rows were returned";
}
} else {
// echo for debugging purposes, you'll want to delete this eventually
echo "No rows were returned";
}
?>
<?php
$currentPage = $_SERVER["PHP_SELF"];
$colname_rsusername = "1";
if (isset($_SESSION['MM_Username'])) {
$colname_rsusername = (get_magic_quotes_gpc()) ? $_SESSION['MM_Username'] : addslashes($_SESSION['MM_Username']);
}
mysql_select_db($database_recommendingpeople, $recommendingpeople);
$query_rsusername = sprintf("SELECT * FROM username WHERE username = '%s'", $colname_rsusername);
$rsusername = mysql_query($query_rsusername, $recommendingpeople) or die(mysql_error());
$row_rsusername = mysql_fetch_assoc($rsusername);
$totalRows_rsusername = mysql_num_rows($rsusername);
$colname_rsbusinessdetails = "1";
if (isset($_SESSION['userid'])){
$colname_rsbusinessdetails = (get_magic_quotes_gpc()) ? $_SESSION['userid'] : addslashes($_SESSION['userid']);
}
mysql_select_db($database_recommendingpeople, $recommendingpeople);
$query_rsbusinessdetails = sprintf("SELECT * FROM businessdetails WHERE userid = %s", $colname_rsbusinessdetails);
$rsbusinessdetails = mysql_query($query_rsbusinessdetails, $recommendingpeople) or die(mysql_error());
$row_rsbusinessdetails = mysql_fetch_assoc($rsbusinessdetails);
$totalRows_rsbusinessdetails = mysql_num_rows($rsbusinessdetails);
$colname_rsbusinessdescription = "1";
if (isset($_SESSION['userid'])) {
$colname_rsbusinessdescription = (get_magic_quotes_gpc()) ? $_SESSION['userid'] : addslashes($_SESSION['userid']);
}
mysql_select_db($database_recommendingpeople, $recommendingpeople);
$query_rsbusinessdescription = sprintf("SELECT * FROM businessdescription WHERE userid = %s", $colname_rsbusinessdescription);
$rsbusinessdescription = mysql_query($query_rsbusinessdescription, $recommendingpeople) or die(mysql_error());
$row_rsbusinessdescription = mysql_fetch_assoc($rsbusinessdescription);
$totalRows_rsbusinessdescription = mysql_num_rows($rsbusinessdescription);
$colname_rsrecommendations = "1";
if (isset($_SESSION['userid'])) {
$colname_rsrecommendations = (get_magic_quotes_gpc()) ? $_SESSION['userid'] : addslashes($_SESSION['userid']);
}
mysql_select_db($database_recommendingpeople, $recommendingpeople);
$query_rsrecommendations = sprintf("SELECT * FROM recommendations WHERE userid = %s", $colname_rsrecommendations);
$rsrecommendations = mysql_query($query_rsrecommendations, $recommendingpeople) or die(mysql_error());
$row_rsrecommendations = mysql_fetch_assoc($rsrecommendations);
$totalRows_rsrecommendations = mysql_num_rows($rsrecommendations);
$maxRows_rsrecommendations = 10;
$pageNum_rsrecommendations = 0;
if (isset($_GET['pageNum_rsrecommendations'])) {
$pageNum_rsrecommendations = $_GET['pageNum_rsrecommendations'];
}
$startRow_rsrecommendations = $pageNum_rsrecommendations * $maxRows_rsrecommendations;
$colname_rsrecommendations = "1";
if (isset($_SESSION['userid'])) {
$colname_rsrecommendations = (get_magic_quotes_gpc()) ? $_SESSION['userid'] : addslashes($_SESSION['userid']);
}
mysql_select_db($database_recommendingpeople, $recommendingpeople);
$query_rsrecommendations = sprintf("SELECT * FROM recommendations WHERE userid = %s", $colname_rsrecommendations);
$query_limit_rsrecommendations = sprintf("%s LIMIT %d, %d", $query_rsrecommendations, $startRow_rsrecommendations, $maxRows_rsrecommendations);
$rsrecommendations = mysql_query($query_limit_rsrecommendations, $recommendingpeople) or die(mysql_error());
$row_rsrecommendations = mysql_fetch_assoc($rsrecommendations);
if (isset($_GET['totalRows_rsrecommendations'])) {
$totalRows_rsrecommendations = $_GET['totalRows_rsrecommendations'];
} else {
$all_rsrecommendations = mysql_query($query_rsrecommendations);
$totalRows_rsrecommendations = mysql_num_rows($all_rsrecommendations);
}
$totalPages_rsrecommendations = ceil($totalRows_rsrecommendations/$maxRows_rsrecommendations)-1;
$queryString_rsrecommendations = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_rsrecommendations") == false &&
stristr($param, "totalRows_rsrecommendations") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_rsrecommendations = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_rsrecommendations = sprintf("&totalRows_rsrecommendations=%d%s", $totalRows_rsrecommendations, $queryString_rsrecommendations);
?>
<?php $MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";
// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && true) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "index.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
$MM_referrer .= "?" . $QUERY_STRING;
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Recommendingpeople/profilesummary</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style3 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 36px;
font-weight: bold;
color: #FFFFFF;
}
.style7 { font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
}
.style12 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; }
.style13 {
font-size: 12px;
font-style: italic;
}
.style18 {font-size: 14px; font-style: italic; color: #0000FF; }
.style20 {color: #0000FF}
.style24 {font-family: Verdana, Arial, Helvetica, sans-serif; color: #0000FF;}
.style26 {font-size: 12px; font-style: italic; color: #0000FF; font-family: Verdana, Arial, Helvetica, sans-serif; }
.style27 {font-size: 12px}
-->
</style>
</head>
<body>
<table width="100%" height="100%" border="0" bgcolor="#FF6600">
<caption>
</caption>
<tr>
<td height="144" colspan="3"><p align="center"><img src="imagesrecommendingpeople/drawingrecommendingpeople.gif" alt="" width="750" height="125" align="top"></p>
<p class="style3">Recommending people...</p></td>
</tr>
<tr>
<td width="15%" height="372"><div align="center">
</div></td>
<td width="70%" bgcolor="#FFFFFF"><p> </p>
<form name="form1" method="post" action="">
<div align="center">
<table width="80%" border="0">
<tr>
<td class="style12">First Name:</td>
<td><?php echo $row_rsusername['firstname']; ?></td>
<td class="style12">Last Name: </td>
<td><?php echo $row_rsusername['lastname']; ?></td>
</tr>
<tr>
<td class="style12">User Name:</td>
<td><?php echo $row_rsusername['username']; ?></td>
<td class="style12">Password:</td>
<td><?php echo $row_rsusername['password']; ?></td>
</tr>
<tr>
<td class="style12">E-mail:</td>
<td><?php echo $row_rsusername['email']; ?></td>
<td class="style12"> </td>
<td> </td>
</tr>
</table>
<p>
<input name="hiddenField4" type="hidden" value="<?php echo $row_rsusername['userid']; ?>">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="150" height="35">
<param name="BGCOLOR" value="">
<param name="movie" value="userupdate.swf">
<param name="quality" value="high">
<embed src="userupdate.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="150" height="35" ></embed>
</object>
</p>
</div>
</form>
<p> </p>
<p> </p>
<form name="form2" method="post" action="">
<div align="center">
<table width="80%" border="0">
<tr class="style12">
<td><span class="style12">Business Category or profession: </span></td>
<td><?php echo $row_rsbusinessdetails['businesscategory']; ?></td>
<td>Business Name: </td>
<td><?php echo $row_rsbusinessdetails['businessname']; ?></td>
</tr>
<tr class="style12">
<td>Street number or name:</td>
<td><?php echo $row_rsbusinessdetails['numbername']; ?></td>
<td>Street:</td>
<td><?php echo $row_rsbusinessdetails['street']; ?></td>
</tr>
<tr class="style12">
<td>Town or Borough:</td>
<td><?php echo $row_rsbusinessdetails['townborough']; ?></td>
<td>City:</td>
<td><?php echo $row_rsbusinessdetails['city']; ?></td>
</tr>
<tr class="style12">
<td>County:</td>
<td><?php echo $row_rsbusinessdetails['county']; ?></td>
<td>State:</td>
<td><?php echo $row_rsbusinessdetails['state']; ?></td>
</tr>
<tr class="style12">
<td>Post Code: </td>
<td><?php echo $row_rsbusinessdetails['postcode']; ?></td>
<td>Country:</td>
<td><?php echo $row_rsbusinessdetails['country']; ?></td>
</tr>
<tr class="style12">
<td>Telephone:</td>
<td><?php echo $row_rsbusinessdetails['tel1']; ?></td>
<td> </td>
<td> </td>
</tr>
</table>
<p>
<input name="hiddenField" type="hidden" value="<?php echo $_SESSION['userid']; ?>">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="150" height="35">
<param name="BGCOLOR" value="">
<param name="movie" value="buttoneditbusdetails.swf">
<param name="quality" value="high">
<embed src="buttoneditbusdetails.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="150" height="35" ></embed>
</object>
</p>
<p> </p>
</div>
</form>
<form name="form3" method="post" action="">
<div align="center">
<table width="80%" border="0">
<tr class="style12">
<td>Tel.2:</td>
<td><?php echo $row_rsbusinessdescription['tel2']; ?></td>
<td>Tel.3:</td>
<td><?php echo $row_rsbusinessdescription['tel3']; ?></td>
</tr>
<tr class="style12">
<td>Web page:</td>
<td><?php echo $row_rsbusinessdescription['webpage']; ?></td>
<td>Business Description Title:</td>
<td><?php echo $row_rsbusinessdescription['businessdescriptiontitle']; ?></td>
</tr>
<tr class="style12">
<td>Business Description: </td>
<td colspan="3"><?php echo $row_rsbusinessdescription['businessdescription']; ?></td>
</tr>
<tr>
<td class="style12">Photo:</td>
<td colspan="3"><?php echo $row_rsbusinessdescription['photo']; ?></td>
</tr>
</table>
<p>
<input name="hiddenField2" type="hidden" value="<?php echo $row_rsbusinessdescription['userid']; ?>">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="150" height="35">
<param name="BGCOLOR" value="">
<param name="movie" value="editbusinessdescription.swf">
<param name="quality" value="high">
<embed src="editbusinessdescription.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="150" height="35" ></embed>
</object>
</p>
</div>
</form>
<?php do { ?>
<form name="form4" method="post" action="">
<div align="center">
<table width="94%" border="0">
<tr class="style12">
<td width="14%">Business Category or Profession </td>
<td width="12%">Business Name </td>
<td width="10%">First Name </td>
<td width="9%">Last Name </td>
<td width="12%">Town or Borough</td>
<td width="6%">City</td>
<td width="9%">County</td>
<td width="7%">State</td>
<td width="10%">Country</td>
<td width="5%">Tel.</td>
<td width="6%">E-mail</td>
</tr>
<tr>
<td><?php echo $row_rsrecommendations['businesscategory']; ?></td>
<td><?php echo $row_rsrecommendations['businessname']; ?></td>
<td><?php echo $row_rsrecommendations['firstname']; ?></td>
<td><?php echo $row_rsrecommendations['lastname']; ?></td>
<td><?php echo $row_rsrecommendations['townborough']; ?></td>
<td><?php echo $row_rsrecommendations['city']; ?></td>
<td><?php echo $row_rsrecommendations['county']; ?></td>
<td><?php echo $row_rsrecommendations['state']; ?></td>
<td><?php echo $row_rsrecommendations['country']; ?></td>
<td><?php echo $row_rsrecommendations['tel']; ?></td>
<td><?php echo $row_rsrecommendations['email']; ?></td>
</tr>
</table>
<p>
<input name="hiddenField3" type="hidden" value="<?php echo $row_rsrecommendations['userid']; ?>">
</p>
</div>
</form>
<div align="center">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="150" height="35">
<param name="BGCOLOR" value="">
<param name="movie" value="editrecommendations.swf">
<param name="quality" value="high">
<embed src="editrecommendations.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="150" height="35" ></embed>
</object>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="200" height="35">
<param name="BGCOLOR" value="">
<param name="movie" value="morerecommendations.swf">
<param name="quality" value="high">
<param name="SCALE" value="exactfit">
<embed src="morerecommendations.swf" width="200" height="35" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" scale="exactfit" ></embed>
</object>
<br>
</div>
<table border="0" width="50%" align="center">
<tr>
<td width="23%" align="center">
<?php if ($pageNum_rsrecommendations > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_rsrecommendations=%d%s", $currentPage, 0, $queryString_rsrecommendations); ?>">First</a>
<?php } // Show if not first page ?> </td>
<td width="31%" align="center">
<?php if ($pageNum_rsrecommendations > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_rsrecommendations=%d%s", $currentPage, max(0, $pageNum_rsrecommendations - 1), $queryString_rsrecommendations); ?>">Previous</a>
<?php } // Show if not first page ?> </td>
<td width="23%" align="center">
<?php if ($pageNum_rsrecommendations < $totalPages_rsrecommendations) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_rsrecommendations=%d%s", $currentPage, min($totalPages_rsrecommendations, $pageNum_rsrecommendations + 1), $queryString_rsrecommendations); ?>">Next</a>
<?php } // Show if not last page ?> </td>
<td width="23%" align="center">
<?php if ($pageNum_rsrecommendations < $totalPages_rsrecommendations) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_rsrecommendations=%d%s", $currentPage, $totalPages_rsrecommendations, $queryString_rsrecommendations); ?>">Last</a>
<?php } // Show if not last page ?> </td>
</tr>
</table>
<?php } while ($row_rsrecommendations = mysql_fetch_assoc($rsrecommendations)); ?>
<table border="0" width="50%" align="center">
<table border="0" width="50%" align="center">
<tr>
<td width="23%" align="center"> First </td>
<td width="31%" align="center"> Previous </td>
<td width="23%" align="center"> Next </td>
<td width="23%" align="center"> Last </td>
</tr>
</table>
</table>
<p> </p> </td>
<td width="15%"><div align="center"><img name="" src="" width="134" height="367" alt=""></div></td>
</tr>
<tr>
<td height="36%"><p align="center" class="style7"><strong>Recommending people...</strong></p>
<p align="center" class="style7"><a href="mailto:administration@recommendingpeople.com">contact us</a></p></td>
<td bgcolor="#FF6600
"><div align="center"><img name="" src="" width="539" height="134" alt=""></div></td bgcolor="#FF6600">
<td><div align="center"><img name="" src="" width="112" height="97" alt=""></div></td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($rsusername);
mysql_free_result($rsbusinessdetails);
mysql_free_result($rsbusinessdescription);
mysql_free_result($rsrecommendations);
?>