Parse Error

Status
Not open for further replies.

mademokid

Baseband Member
Messages
28
Could someon please find the offending code thats causing a 'Parse Error: parse error, unexpected $ in /home/www/askscholey.com/index2.php on line 193'
Code:
<?php
// Connects to your Database
mysql_connect("example", "example", "example") or die(mysql_error());
mysql_select_db("example") or die(mysql_error());

//checks cookies to make sure they are logged in
if(isset($_COOKIE['ID_my_site']))
{
$username = $_COOKIE['ID_my_site'];
$pass = $_COOKIE['Key_my_site'];
$check = mysql_query("SELECT * FROM users WHERE username = '$username'")or die(mysql_error());
while($info = mysql_fetch_array( $check ))
{

//if the cookie has the wrong password, they are taken to the login page
if ($pass != $info['password'])
{ header("Location: nmindex.php");
}

//otherwise they are shown the admin area
else
{

'
<html>
<head>
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="http://forum.askscholey.com/images/icon.ico" type="image/x-icon">
<title>.: Ask Scholey.com :.</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css/styles.css" type="text/css">
<style type="text/css">
<!--
.style2 {color: #000000}
.style3 {color: #72889D}
-->
</style>
</head>
<body bgcolor="#CCCCCC" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="780" height="70" border="0" align="center" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr> 
    <td width="780" height="76" align="left" valign="middle" background="images/img1.gif" class="logo" style="padding-left:25px; padding-right:25px;"><div align="right">Ask Scholey.com</div></td>
  </tr>
</table>
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <!--DWLayoutTable-->
  <tr> 
    <td height="70" colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
        <!--DWLayoutTable-->
        <tr>
          <td width="780" height="70" align="left" valign="middle" background="images/img2.gif" style="padding-left:25px; padding-right:20px; padding-bottom:20px; padding-top:20px;"><span class="text1 style2"><a href="http://www.askscholey.com" class="a">Home</a>    <span class="style3 style3"><a href="http://forum.askscholey.com" class="a">Forum</a></span>    <a href="http://askscholey.com/contact.html" class="a">Contact Us</a></span>   <a href="http://www.askscholey.com/links.html" class="a">Links</a>  </td>
        </tr>
        </table></td>
  </tr>
  <tr>
    <td width="276" rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="276" height="382" valign="top" style="padding-left:20px; padding-right:20px; padding-bottom:20px; padding-top:10px;"><p class="text">
		</p>
          <p> </p>
          <p><span class="title">Welcome to Ask Scholey!</span></p>
          <p class="text">Need help? Ask Scholey! This is the place to be for homework help and general chat. Our forums are througly moderated and all members accepted as long as they can provide a valid email address. What are you waiting for? Click the forum link above and get ready to Ask Scholey! </p>
          <p class="text">  </p></td>
      </tr>
    </table></td>
    <td width="504" height="182" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="504" height="182" valign="top" style="padding-left:20px; padding-right:20px; padding-bottom:20px; padding-top:10px;"><p class="text"><span class="title">Services<br>
                <br>
          </span><img src="images/img3.jpg" width="151" height="147" hspace="5" border="2" align="left">We offer a help service for homework and a comprehensive answers service for all other questions and queries. Although we cannot guarentee the quality of our answers, we do try our best to answer your question and give you the correct answer. </p>
          </td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="198" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="504" height="200" valign="top" style="padding-left:20px; padding-right:20px; padding-bottom:20px; padding-top:10px;">
            <p class="text"><b><span class="title"><strong><u>Latest Forum News</u></strong></span><br>
              <br>
              <span class="a">'
			  ?>
			  <?
#####################################################
##### IPB News Script v1.1 by Adam Stasiniewicz #####
##### Copyright © 2004 Adam Stasiniewicz        #####
##### http://www.adamscs.com                    #####
#####################################################

# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.


##############################################################################################
##### Configuration section, please edit this info to meet your specific setup and needs #####
##############################################################################################

//database address
$databaseip = 'example';
//name of the database the stores IPB
$databasename = 'example';
//database username
$username = 'example';
//database password
$password = 'example';
//the forum id of the news forum (look for the XX in index.php?showforum=XX part of the forums URL)
$forumid = '1';
//how many news post you want to show
$topicrows = '1';

##
## IPB 2.0-only Settings
##
// enter the name of the emoticons set you want to use on the homepage (look in your skin config setting, or else leave it as is)
$emoticons = 'default';
// Enter the name of the image directory that you want the script to use (look in your skin config setting, or else leave it as is)
$img_dir = '1';

##########################################################
##### Code starts here, scroll down to edit template #####
##########################################################

mysql_connect ($databaseip, $username, $password);
mysql_select_db ($databasename);
$topicq = mysql_query ("select* from ibf_topics where forum_id=".$forumid." order by start_date desc");
for ($i=0; $i <$topicrows; $i++)
{
$topicrow = mysql_fetch_array($topicq);
$titleid = $topicrow["tid"];
$topictitle = ($topicrow["title"]);
$postq = mysql_query ("SELECT * FROM `ibf_posts` where topic_id = ".$titleid." and new_topic = 1 order by post_date");
$postfetch = mysql_fetch_array($postq);
$postrow = $postfetch["post"];
$unixdate = $topicrow["start_date"];
$date = date("F jS, Y",$unixdate);
$writter = $topicrow["starter_name"];
$postrow = str_replace('<#EMO_DIR#>', $emoticons, $postrow); 
$postrow = str_replace('<#IMG_DIR#>', $img_dir, $postrow);

#########################################################################################################################
##### Everything between the echo (' and '); is the template for the "repeating" section.                           #####
##### Useful variables:                                                                                             #####
##### '.$topictitle.' = The title of the news post.                                                                 #####
##### '.$postrow.' = The actual text of the news post.                                                              #####
##### '.$writter.' = The name of the person that wrote the news post.                                               #####
##### '.$date.' = The date of the news post.                                                                        #####
##### '.$titleid.' = The numeric number IPB givies to the topic.  Useful if you want to generate a "comments" link. #####
#####                                                                                                               #####
##### Below is an example, edit it to meet your needs.                                                              #####
#########################################################################################################################
echo ('  

<p>'.$topictitle.'</p>
<p>'.$postrow.'</p>
<p>'.$writter.'</p>
<p>'.$date.'</p>
<p><a href="http://forum.askscholey.com/index.php?showtopic='.$titleid.'">Comments?</a></p>
<p><hr></p>

');

} ?>
<? '</span>          </td>
      </tr>
    </table></td>
  </tr>
  
</table>
<table width="780" height="40" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#E01C03">
  <tr> 
    <td height="24" align="center" valign="middle" class="text1"> Copyright © 
      2007 Ask Scholey. All rights reserved. Designed by <a href="http://www.templatesland.com" target="_blank" class="a">TemplatesLand</a>
	  </td>
  </tr>
</table>

</body>
</html>'
 
The code doesn't terminate the line, nor the PHP expression.

Each line should end with a ;
Every php code area must start with <? and end with ?>

So, try adding
Code:
; ?>
to the end of your code. :)
 
Status
Not open for further replies.
Back
Top Bottom