Page 1 of 1
[SOLVED]a problem with me and echoing html and variables
Posted: Wed Jun 16, 2004 10:53 am
by Andrus
parse error, parse error parse error,
i get a parse error, on line 13,
what the heck is wrong with this line?
Code: Select all
echo "<td class='text1' height='75'><img src='images/bullet4.gif' width='16' height='15' align='center'><font color='#003366'><b>$title</b></font><br>$text</td></tr></tbody></table><br>";
thanks
Posted: Wed Jun 16, 2004 10:55 am
by JayBird
nothing wrong with that line.
Show your whole code, sometimes errors on previous lines can cuase errors on subsequent lines.
Mark
Posted: Wed Jun 16, 2004 4:37 pm
by Andrus
k thanks, here it is
Code: Select all
<?
include 'header.htm';
include 'config.php";
function index(){
$db = mysql_connect($db_host,$db_user,$db_pass);
mysql_select_db ($db_name) or die ("Cannot connect to database");
$query = "SELECT title, text FROM blog ORDER BY id DESC LIMIT 10";
$result = mysql_query($query);
while($r=mysql_fetch_array($result))
{
$title=$r["title"];
$text=$r["text"];
echo "<td class='text1' height='75'><img src='images/bullet4.gif' width='16' height='15' align='center'><font color='#003366'><b>$title</b></font><br>$text</td></tr></tbody></table><br>";
}
mysql_close($db);
}
function news(){
echo "<td class='text1' height='75'><img src='images/bullet4.gif' width='16' height='15' align='middle'><b><font color='#003366'>News</font></b><br>";
echo "Blog still being worked on, hopefully up soon";
}
function submit(){
echo "<form name='post' action='post_news_process.php' method='post'>Title<input name='title' type='text' size='25'><br>Text<br><textarea name='text' cols='40' rows='6'></textarea><input type='submit' name='Submit' value='POST'></form>";
}
switch($_REQUEST['do']){;
default:
index();
break;
case "news":
news();
break;
case "submit":
submit();
break;
}
include 'footer.htm';
?>
Posted: Wed Jun 16, 2004 4:39 pm
by feyd
include 'config.php";
that's the problem