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>

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.