You are here: Newbie - expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' « PHP Programming Language « IT news, forums, messages
Newbie - expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING'

Posted by toedipper on 06/28/05 01:15

Hello,

I have the code below. However, when I try and 'run' it I get a message
pars error expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' on line 76

I have marked line 76 below in in capital letters. I cannot see what
the problem is. My code simply looks at a db and if the result is zero
then is shows stuff x on screen and if it's > 0 then it shows stuff y.
There is more code after the php but it's basically the html stuff.

Any ideas?

Thanks,

td.



<?
session_start();
if ($_SESSION['valid'] != "yes") {
header("Location: http://127.0.0.1/index.php");
exit;
}
require_once('Connections/local.php');

$currentPage = $_SERVER["PHP_SELF"];


$maxRows_showresults = 10;
$pageNum_showresults = 0;
if (isset($_GET['pageNum_showresults'])) {
$pageNum_showresults = $_GET['pageNum_showresults'];
}
$startRow_showresults = $pageNum_showresults * $maxRows_showresults;

mysql_select_db($database_local, $local);
$query_showresults = "SELECT sw.swid, title, shortdesc, version, catid,
count(dl.swid), warename FROM software sw left join downloads dl on
sw.swid = dl.swid join waretypes wt on sw.wareid = wt.wareid WHERE catid
= '$_GET[catid]' AND liveyn = 'y' GROUP BY sw.swid, title, shortdesc,
version, catid";
$query_limit_showresults = sprintf("%s LIMIT %d, %d",
$query_showresults, $startRow_showresults, $maxRows_showresults);
$showresults = mysql_query($query_limit_showresults, $local) or
die(mysql_error());
$row_showresults = mysql_fetch_assoc($showresults);

if (isset($_GET['totalRows_showresults'])) {
$totalRows_showresults = $_GET['totalRows_showresults'];
} else {
$all_showresults = mysql_query($query_showresults);
$totalRows_showresults = mysql_num_rows($all_showresults);
}
$totalPages_showresults =
ceil($totalRows_showresults/$maxRows_showresults)-1;


$queryString_showresults = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_showresults") == false &&
stristr($param, "totalRows_showresults") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_showresults = "&" . htmlentities(implode("&",
$newParams));
}
}
$queryString_showresults = sprintf("&totalRows_showresults=%d%s",
$totalRows_showresults, $queryString_showresults);

if (mysql_num_rows($query_showresults) == 0) {

$display_block = "
<p>There are no applications currently listed under this category. </p>
<p>Attention all Developers and software houses! Let your application
be the first listed under this category!</p>
<p>Click here to add your application under his category.<br>
</p>";
} else {
$display_block = "
<div align=\"left\">
<table width=\"608\" height=\"271\" border=\"0\" align=\"center\"
cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td><div align=\"left\"><table width=\"725\"
border=\"0\" height=\"291\" cellpadding=\"0\">
<tr>
<td height=\"661\" align=\"center\" valign=\"top\"><p
align=\"center\">
<font face=\"Arial, Helvetica,
sans-serif\"></font><font face=\"Arial, Helvetica, sans-serif\"><br>
<table width=\"100%\" border=\"0\">
<tr bgcolor=\"#99CCFF\">
<td width=\"102\"><div
align=\"center\"><strong><font color=\"#FFFFFF\" size=\"2\"
face=\"Arial, Helvetica, sans-serif\">Title</font></strong></div></td>
<td width=\"138\"><div
align=\"center\"><strong><font color=\"#FFFFFF\" size=\"2\"
face=\"Arial, Helvetica, sans-serif\">Desc</font></strong></div></td>
<td width=\"121\"><div
align=\"center\"><strong><font color=\"#FFFFFF\" size=\"2\"
face=\"Arial, Helvetica, sans-serif\">Version</font></strong></div></td>
<td><div align=\"center\"><strong><font
color=\"#FFFFFF\" size=\"2\" face=\"Arial, Helvetica,
sans-serif\">Ware</font></strong></div></td>
<td width=\"70\"><div
align=\"center\"><strong><font color=\"#FFFFFF\" size=\"2\"
face=\"Arial, Helvetica, sans-serif\">Downloads</font></strong></div></td>
</tr>
<? do { ?>
<tr>
76 THIS IS THE ERROR LINE <td><div align=\"center\"><font size=\"2\"><a
href=\"showdetail.php?swid=<? echo $row_showresults['swid']; ?>\"><?
echo $row_showresults['title']; ?></a></font></div></td>
<td><div align=\"center\"><font size=\"2\"
face=\"Arial, Helvetica, sans-serif\"><? echo
$row_showresults['shortdesc']; ?></font></div></td>
<td><div align=\"center\"><font size=\"2\"
face=\"Arial, Helvetica, sans-serif\"><? echo
$row_showresults['version']; ?></font></div></td>
<td><font size=\"2\" face=\"Arial, Helvetica,
sans-serif\"><?php echo $row_showresults['warename']; ?></font></td>
<td><div align=\"center\"><font size=\"2\"
face=\"Arial, Helvetica, sans-serif\"><? echo
$row_showresults['count(dl.swid)']; ?></font></div></td>
</tr>
<?php } while ($row_showresults =
mysql_fetch_assoc($showresults)); ?>
</table>
</font> <p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p align=\"center\">
<table border=\"0\" width=\"50%\" align=\"center\">
<tr>
<td width=\"23%\" align=\"center\"><?php if
($pageNum_showresults > 0) { // Show if not first page ?>
<a href=\"<?php
printf(\"%s?pageNum_showresults=%d%s\", $currentPage, 0,
$queryString_showresults); ?>\">First</a>
<?php } // Show if not first page ?>
</td>
<td width=\"31%\" align=\"center\"><?php if
($pageNum_showresults > 0) { // Show if not first page ?>
<a href=\"<?php
printf(\"%s?pageNum_showresults=%d%s\", $currentPage, max(0,
$pageNum_showresults - 1), $queryString_showresults); ?>\">Previous</a>
<?php } // Show if not first page ?>
</td>
<td width=\"23%\" align=\"center\"><?php if
($pageNum_showresults < $totalPages_showresults) { // Show if not last
page ?>
<a href=\"<?php
printf(\"%s?pageNum_showresults=%d%s\", $currentPage,
min($totalPages_showresults, $pageNum_showresults + 1),
$queryString_showresults); ?>\">Next</a>
<?php } // Show if not last page ?>
</td>
<td width=\"23%\" align=\"center\"><?php if
($pageNum_showresults < $totalPages_showresults) { // Show if not last
page ?>
<a href=\"<?php
printf(\"%s?pageNum_showresults=%d%s\", $currentPage,
$totalPages_showresults, $queryString_showresults); ?>\">Last</a>
<?php } // Show if not last page ?>
</td>
</tr>
</table>
<br>
<a href=\"index.php\">Back to Home Page</a>
<p align=\"center\"> <br>
</td>
<td width=\"120\" height=\"578\" align=\"center\"
valign=\"top\" bgcolor=\"#0000FF\">
And even something more goes here</td>
</tr>
</table>

</div>

</td>

</tr>

</table>";
}
?>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация