Posted: Wed Jan 28, 2004 7:02 pm
Those tutorials are crap?
I beg to differ, sir. I think Dreamweaver is the one that is crap. As I will always say, write your own HTML. Better custimization, and gives you much much more satisfaction!
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<?php
$db = mysql_connect("localhost","","") or die ("cant connect");
mysql_select_db("team101",$db) or die ("cant change");
$news = mysql_query("select * from team101_news ORDER BY date DESC LIMIT 8") or die ("cant get em");
while($rows = mysql_fetch_array($news))
{
$date = $rows["date"];
$author = $rows["author"];
$title = $rows["title"];
$content = $rows["content"];
$number = "100%";
echo "<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#333333" width="50%" id="AutoNumber1" height="64">\n";
echo "<tr>\n";
echo "<td width="100%" bordercolor="#000000" bgcolor="#FF9900" height="19">\n";
echo "<font face="Verdana" style="font-size: 12px" color="#FFFFFF">\n";
echo $title . "<br />" . $date;
echo "</tr>\n";
echo "<tr>\n";
echo "<td width="100%" bgcolor="#525252" height="24">\n";
echo "<font color="#FFFFFF" face="Verdana" style="font-size: 12px">\n";
echo $content;
echo "</font></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td width="100%" bgcolor="#808080" height="19">\n";
echo $author;
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
}
?>Code: Select all
<?php
echo "sdlkfjlskdjflksdjflkj"
."dkfjflksdjfkldjfklj"
."fkjdklfjlksdj";
?>Nay not here? He'd say: HEREDOC-it:Phenom wrote:Instead of continuously using echo function you can do thisCode: Select all
<?php echo "sdlkfjlskdjflksdjflkj" ."dkfjflksdjfkldjfklj" ."fkjdklfjlksdj"; ?>
Code: Select all
echo <<<HEREDOC and then you can type all the text
you want, but i do not feel like typing a lot at the moment
so you'll have to believe me or just ask Nay!
HEREDOC;
?>