Jump to content

check my php abilities?


shedokan

Recommended Posts

I say, make a page where people can add, edit and delete comments that can be put in either MySQL or just a TXT file, your choice. Oh, and do not use bare HTML, so do this:

 

<?php
echo '<html>';
echo '<body>'
echo 'Hello World';
echo '</html>';
echo '</body>'
?>

 

Instead of:

 

<html>
<body>
<?php echo 'Hello World'; ?>
</html>
</body>

Please don't do it that way.

 

echo is relatively expensive compared to breaking in and out of PHP to output flat HTML.

 

Hell, even a HEREDOC is faster than an echo.

 

<html>
<body>
<?php echo 'Hello World'; ?>
</html>
</body>

 

Is cleaner and more easily modified/read. Don't start off on the wrong foot. :)

 

Just look at the two parsing errors in the code provided - that he probably didn't even notice.

 

These forums aren't always the best place to look for 'best practices' information. Good place to get a start, but don't get your habits from this joint :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.