newbie error, very strange



hi,

I've got a problem that I cant deal with:

I've got a a simple class in a file browse.inc:

<?php
class Connection
{
public $conn;
public $result;
public $resultMeta = array();

}

?>

the file browse.php looks like this:

<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html401/loose.dtd";>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-2">
<title>Connection</title>
</head>
<body>
<pre>

<?php

include "browse.inc";
?>

</pre>
</body>
</html>

when I run this file everything is ok.

but when I run this file from a file index.php through a z link:

<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html401/loose.dtd";>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-2">
<title>Connection</title>
</head>
<body>

<h1>DB programming using MySQL and PHP 5.0</h1>

<p>This is a website created in order to get a credit from a DB
laboratoty.
It displays a table and allows to add, remove and update records from
this table.
What would you like to do??</p>

<pre>
<?php
print "\n <a href=http://localhost\DB\browse.php> Browse table
</a>";
?>

</pre>
</body>
</html>

then I get the error parse error, expecting `T_OLD_FUNCTION' or
`T_FUNCTION' or `T_VAR' or `'}''

in line 4 of file browse.inc.

I dunno what may cause this error, maybe someone of you would like to
help me with this.

Pafcio

.



Relevant Pages

  • newbie error, very strange
    ... public $conn; ...
    (alt.php)
  • Re: newbie error, very strange
    ... most web servers aren't configured to treat .inc files as php scripts ... you should always put html tag values inside double quotes, ... You can alway use http://validator.w3.org/ to check your html output is ...
    (alt.php)
  • Re: PHP and ASP.NET go HEAD to HEAD
    ... What is "head to head" about his comparison? ... performance must be considered in comparing platforms -- and ASP.NET is no ... want to take half a step backwards and build one in PHP either, ... > ASP.NET officially requires that you use IIS. ...
    (microsoft.public.dotnet.framework)
  • Re: PHP and ASP.NET go HEAD to HEAD
    ... What is "head to head" about his comparison? ... performance must be considered in comparing platforms -- and ASP.NET is no ... want to take half a step backwards and build one in PHP either, ... > ASP.NET officially requires that you use IIS. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: PHP and ASP.NET go HEAD to HEAD
    ... What is "head to head" about his comparison? ... performance must be considered in comparing platforms -- and ASP.NET is no ... want to take half a step backwards and build one in PHP either, ... > ASP.NET officially requires that you use IIS. ...
    (microsoft.public.dotnet.framework.performance)