Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help! This error is driving me crazy!

Status
Not open for further replies.

fowlerlfc

MIS
Mar 20, 2002
136
US
When using an include file of functions, I get the following error:

Parse error: parse error, unexpected $ in /usr/local/apache_1.3.20/htdocs/dev/functions.php on line 195

In my include file there is not line 195! My closing php bracket is on line 186! I have no clue to fix this, any ideas?

Here's my include file:

<?
//display functions


function pageheaders($title)
{
echo &quot;<head><title>$title</title>&quot;;
echo &quot;<style type=\&quot;text/css\&quot;>&quot;;
echo &quot;<!--&quot;;
echo &quot;body {&quot;;
echo &quot;background-attachment : scroll;&quot;;
echo &quot;background-color : #FFFFFF;&quot;;
echo &quot;background-image : url(\&quot;gbg.gif\&quot;);&quot;;
echo &quot;background-repeat : no-repeat;&quot;;
echo &quot;}&quot;;
echo &quot;-->&quot;;
echo &quot;</style></head><body>&quot;;
}

function userheaders($title, $redirect, $time)
{
echo &quot;<head><title>$title</title>&quot;;
echo &quot;<style type=\&quot;text/css\&quot;>&quot;;
echo &quot;<!--&quot;;
echo &quot;body {&quot;;
echo &quot;background-attachment : scroll;&quot;;
echo &quot;background-color : #FFFFFF;&quot;;
echo &quot;background-image : url(\&quot;gbg.gif\&quot;);&quot;;
echo &quot;background-repeat : no-repeat;&quot;;
echo &quot;}&quot;;
echo &quot;-->&quot;;
echo &quot;</style></head><body onLoad=window.setTimeout(\&quot;location.href='$redirect'\&quot;,$time)>&quot;;
}

function headermenu()
{
echo &quot;<center><table width=\&quot;100%\&quot; border=\&quot;0\&quot;>&quot;;
echo &quot;<tr><td width=\&quot;16%\&quot;><div align=\&quot;center\&quot;>Chat</div></td>&quot;;
echo &quot;<td width=\&quot;16%\&quot;><div align=\&quot;center\&quot;>email</div></td>&quot;;
echo &quot;<td width=\&quot;16%\&quot;><div align=\&quot;center\&quot;>reports</div></td>&quot;;
echo &quot;<td width=\&quot;16%\&quot;><div align=\&quot;center\&quot;>add workorder</div></td>&quot;;
echo &quot;<td width=\&quot;16%\&quot;><div align=\&quot;center\&quot;>personal data</div></td>&quot;;
echo &quot;<td width=\&quot;20%\&quot;><div align=\&quot;center\&quot;>logout</div></td></tr></table></center>&quot;;
}



function footermenu()
{
echo &quot;<table width=\&quot;100%\&quot; border=\&quot;0\&quot; bordercolor=\&quot;#00cf63\&quot; bgcolor=\&quot;#00Cf63\&quot;>&quot;;
echo &quot;<tr><td><table width=\&quot;100%\&quot; border=\&quot;0\&quot;>&quot;;
echo &quot;<tr><td width=\&quot;16%\&quot;><div align=\&quot;center\&quot;>chat</div></td>&quot;;
echo &quot;<td width=\&quot;16%\&quot;><div align=\&quot;center\&quot;>email</div></td>&quot;;
echo &quot;<td width=\&quot;16%\&quot;><div align=\&quot;center\&quot;>reports</div></td>&quot;;
echo &quot;<td width=\&quot;16%\&quot;><div align=\&quot;center\&quot;>add workorder</div></td>&quot;;
echo &quot;<td width=\&quot;16%\&quot;><div align=\&quot;center\&quot;>personal data</div></td>&quot;;
echo &quot;<td width=\&quot;20%\&quot;><div align=\&quot;center\&quot;>logout</div></td></tr></table></td></tr>&quot;;
echo &quot;<tr><td><div align=\&quot;center\&quot;><p>&quot;;
echo &quot;This internal website is for LTD Direct employees. Unauthorized use&quot;;
echo &quot; or access is prohibited. <br>&quot;;
echo &quot;To report abuse or bugs email amiller@ltddirect.com&quot;;
echo &quot;</p></div></td></tr></table>&quot;;

}


function pagefooters()
{
echo &quot;</body>&quot;;
echo &quot;&quot;;
}



function loginform()
{
echo &quot;<a href=\&quot;registerform.php\&quot;>Not a member?</a>&quot;;
echo &quot;<form method=post action=\&quot;member.php\&quot;>&quot;;
echo &quot;<table>&quot;;
echo &quot;<tr>&quot;;
echo &quot;<td colspan=2>Members log in here:</td>&quot;;
echo &quot;<tr>&quot;;
echo &quot;<td>Username:</td>&quot;;
echo &quot;<td><input type=text name=username></td></tr>&quot;;
echo &quot;<tr>&quot;;
echo &quot;<td>Password:</td>&quot;;
echo &quot;<td><input type=password name=passwd></td></tr>&quot;;
echo &quot;<tr>&quot;;
echo &quot;<td colspan=2 align=center>&quot;;
echo &quot;<input type=submit value=\&quot;Log in\&quot;></td></tr>&quot;;
echo &quot;<tr>&quot;;
echo &quot;<td colspan=2><a href=\&quot;forgot_form.php\&quot;>Forgot your password?</a></td>&quot;;
echo &quot;</tr>&quot;;
echo &quot;</table></form>&quot;;
}



function regform()
{

echo &quot;<form method=post action=\&quot;register_new.php\&quot;>&quot;;
echo &quot;<table>&quot;;
echo &quot;<tr><td>Email address:</td>&quot;;
echo &quot;<td><input type=text name=email size=30 maxlength=100></td></tr>&quot;;
echo &quot;<tr><td>Preferred username <br>(max 16 chars):</td>&quot;;
echo &quot;<td valign=top><input type=text name=username size=16 maxlength=16></td></tr>&quot;;
echo &quot;<tr><td>Password <br>(between 6 and 16 chars):</td>&quot;;
echo &quot;<td valign=top><input type=password name=passwd size=16 maxlength=16></td></tr>&quot;;
echo &quot;<tr><td>Confirm password:</td>&quot;;
echo &quot;<td><input type=password name=passwd2 size=16 maxlength=16></td></tr>&quot;;
echo &quot;<tr><td colspan=2 align=center><input type=submit value=\&quot;Register\&quot;></td></tr>&quot;;
echo &quot;</table></form>&quot;;



//authorization functions


function userlogin($username, $password)
//check username and password with db
//if yes, return true
//else return false
{
//connect to db
$conn = userdbconnect();
if (!$conn)
return 0;

//check username
$result = mysql_query(&quot;select * from user where username='$username'
and passwd = password('$password')&quot;);

if (!result)
return 0;

if (mysql_num_rows($result)>0)
return 1;
else
return 0;
}

function checkvaliduser()
//see if somebody is logged in and notify them if not
{
global $validuser;
global $validfirst;
global $validlast;
global $validemail;
global $validext;
global $validlocation;
if (session_is_registered(&quot;validuser&quot;, &quot;validfirst&quot;, &quot;validlast&quot;, &quot;validemail&quot;, &quot;validext&quot;, &quot;validlocation&quot;))
{
echo &quot;Logged in as $validuser.&quot;;
echo &quot;<br>&quot;;
}
else
{
pageheaders(&quot;Problem:&quot;);
echo &quot;You are logged in.<br>
You must be logged in to view this page.<br>
Click <a href=\&quot;login.php\&quot;>here</a> to login.&quot;;
pagefooters();
exit;
}
}






//db functions
function userdbconnect()
{
$result = mysql_pconnect(&quot;localhost&quot;, &quot;wouser&quot;, &quot;09fowler23&quot;);
if (!$result)
return false;
if (!mysql_select_db(&quot;workorder&quot;))
return false;

return $result;
}

?>
 
The error is in the functions.php file.

Is this code in the functions.php file? Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com
 
add another } before the very last ?> like

}
?> ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top