Can someone please explain what I am doing wrong here? Below is the code I am using to extend a class I already created. The page class works perfectly, so no problem there. The URL that leads to this page is of the form:
http://www.domain.net/author.php?authorid=xx
I get this error: Parse error: parse error, unexpected T_VARIABLE in /home/virtual/site1/fst/home/meandthee/public_html/authorpage.inc on line 10.
I've tried numerous variations, including just defining var $authorid;, not defining it, calling it with $this->, calling it without $this->, etc and I can't figure this out.
Thanks,
Trixie
// START CODE
<?
require ("page.inc");
class AuthorPage extends Page
{
// class authorpage's attibutes
Line 10 var $authorid = $_GET[authorid];
// class authorpage's operations
function GetAuthorInfo($this->authorid)
{
@ $db = mysql_pconnect("localhost", "user", "password");
if (!$db)
{
echo "Error: Could not connect to database. Please try again later.";
}
mysql_select_db("domain_net");
$autid_query = "select * from table where authorid = $authorid;";
$autid_result = mysql_query($autid_query);
$autid_row = mysql_fetch_array($autid_result);
}
function DisplayAuthorHeader()
{
echo "<font size=+4>";
if ($autid_row["firstname"])
{
echo stripslashes($authid_row["firstname"])." ";
}
echo stripslashes($authid_row["lastname"]);
echo "</font><br><br>\n\n";
}
}
?>
// END CODE