Page 1 of 1

Parse error: parse error, unexpected T_STRING

Posted: Sun Jul 18, 2004 6:11 am
by degrate
feyd | Please use

Code: Select all

tags when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]


Hi,
I have a small script which give a Parse error: parse error, unexpected T_STRING in //test.php on line 25 of the below code. Can anyone help?

Code: Select all

<?php
$maxRows_rstotd = 1;
$pageNum_rstotd = 0;
if (isset($HTTP_GET_VARS['pageNum_rstotd'])) {
  $pageNum_rstotd = $HTTP_GET_VARS['pageNum_rstotd'];
}
$startRow_rstotd = $pageNum_rstotd * $maxRows_rstotd;

mysql_select_db($database_database, $database);
$query_rstotd = "SELECT * FROM totd";
$query_limit_rstotd = sprintf("%s LIMIT %d, %d", $query_rstotd, $startRow_rstotd, $maxRows_rstotd);
$rstotd = mysql_query($query_limit_rstotd, $database) or die(mysql_error());
$row_rstotd = mysql_fetch_assoc($rstotd);

if (isset($HTTP_GET_VARS['totalRows_rstotd'])) {
  $totalRows_rstotd = $HTTP_GET_VARS['totalRows_rstotd'];
} else {
  $all_rstotd = mysql_query($query_rstotd);
  $totalRows_rstotd = mysql_num_rows($all_rstotd);
}
$totalPages_rstotd = ceil($totalRows_rstotd/$maxRows_rstotd)-1;
?>
[b]<?xml version="1.0" encoding="iso-8859-1"?>[/b]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<html xmlns="http://www.w3.org/1999/xhtml">

feyd | Please use

Code: Select all

tags when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Sun Jul 18, 2004 7:17 am
by kettle_drum
If the server allows short tags to be used then it may try and parse the xml version line. Try to just echo the code instead of switching out of php.