Parse error: parse error, unexpected T_STRING

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
degrate
Forum Newbie
Posts: 1
Joined: Sun Jul 18, 2004 6:11 am

Parse error: parse error, unexpected T_STRING

Post 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]
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post 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.
Post Reply