PDA

View Full Version : Php parse error


hotma1l
06-03-2007, 01:05 PM
I am getting this error in cpanel

PHP Parse error: syntax error, unexpected T_STRING in /home/mixq8/public_html/vb/last.php on line 17

here is the last.php code

<?
require("mxq8last.php");
require("includes/config.php");


echo "<FONT color=$tc ><marquee onmouseover=this.stop() onmouseout=this.start() dir=\"rtl\" direction=\"right\" scrolldelay=\"100\"><FONT SIZE=\"1\" FACE=\"MS Sans Serif\"><font color=\"#000000\">&nbsp; ";;
//...............Last 10 Posts v2.0.1...........\\
//.........by Kevin (kevin@tubescan.com)........\\
//.....Edit by lad_pc (lad_pc@hotmail.com)......\\
//......????? NetMan .........\\
//......... (c) 2001 taiba.port5.com ...........\\

// vBulletin.com thread: http://www.vbulletin.com/forum/showthread.php?threadid=12324
// vBulletin.com thread: http://www.taiba.port5.com/ let's get connected


$db=mysql_connect(localhost,mixq8_dddd,dddd) or die("Can't open connection to MySQL");
mysql_select_db(mixq8_dddd) or die("Can't select database");

$hfs = $fs+2;
$fs .= "pt";
$hfs .= "pt";



// the base WHERE statement
$wheresql = "WHERE thread.lastposter=user.username AND thread.open!='10'";

// we can't have both the last 24 hours *and* the last 7 days, so error out if needed
if ($last24 == "1" && $last7 == "1") {
print("Error: \$last24 and \$last7 are both set to 1. Please change one of them to 0.");
exit;
}
// otherwise we're gonna find out which one it is
// last 24
if ($last24 == "1") {
$time = time()-86400;
$wheresql .= " AND thread.lastpost>'$time'";
}
// last 7
if ($last7 == "1") {
$time = time()-604800;
$wheresql .= " AND thread.lastpost>'$time'";
}
// are we trying to exclude *and* include forums? if so, error out
if ($excludeforums != "" && $includeforums != "") {
print("Error: \$includeforums and \$excludeforums are both set with numbers. Please remove the numbers from <b>one</b> of these two to proceed.");
exit;
}
// otherwise figure out which one we're using
// include forums
if ($includeforums == "" or $includeforums <= "0") {
$quarter = "no";
} else {
$incfid = explode(",",$includeforums); $i = 0; $a = count($incfid);
if ($a > 1) {
$wheresql .= " AND (thread.forumid='$incfid[0]'";
++$i;
while ($i < $a) {
$wheresql .= " OR thread.forumid='$incfid[$i]'"; ++$i;
}
$wheresql .= ")";
} else {
$wheresql .= " AND thread.forumid='$incfid[$i]'";
}
}
// or exclude forums
if ($excludeforums == "" or $excludeforums <= "0") {
$quarter = "no";
} else {
$excfid = explode(",",$excludeforums); $i = 0; $a = count($excfid);
while ($i < $a) {
$wheresql .= " AND thread.forumid!='$excfid[$i]'"; ++$i;
}
}

// ooh a query!
$query = "SELECT thread.lastpost,thread.title,thread.lastposter,thr ead.replycount,thread.views,user.userid,thread.thr eadid,thread.forumid,thread.iconid FROM thread,user $wheresql ORDER BY thread.$ob $obdir LIMIT $maxthreads";
// let's get the info
$tr = mysql_query($query) or die("MySQL reported this error while trying to retreive the info: ".mysql_error());
$dtf = mysql_query("SELECT value FROM setting WHERE varname='dateformat' OR varname='timeformat' OR varname='timeoffset' ORDER BY varname");
$df = mysql_result($dtf,0,0);
$tf = mysql_result($dtf,1,0);
$tof = mysql_result($dtf,2,0);


// let's display the info
while ($threads = mysql_fetch_array($tr)) {

echo " <FONT SIZE=\"1\" FACE=\"MS Sans Serif\"><a href=\"$url/showthread.php?=$session[sessionhash]&threadid=$threads[threadid]&goto=newpost\" title=\"$threads[title]\" target=_blank><font color=\"#226FBB\">$threads[title] ( ??? ?? : $threads[lastposter] ) ?????? : $threads[replycount] &nbsp</font></a><font color=\"#000000\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ? &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font>";
}
// close it all up
// bye!

?></marquee>


what seems to be the problem

thank you

vectorfc
06-03-2007, 01:26 PM
There aren't any quotes around your database parameters.

Try

$db=mysql_connect("localhost","mixq8_dddd","dddd") or die("Can't open connection to MySQL");