Bir "doğru" var mı

0 Cevap php

Ben sadece ona uzakta takarak, php öğrenme edilmiştir.

Birisi güvenlik, akışı ve genel en iyi uygulamalar açısından doğru yönde bana gelin umuyordum?

Teşekkürler.

edit -

I suppose a better way to phrase what i am trying to ask is.. What is the best practice:
1.) when processing forms with php, get vs post, $_REQUEST vs $_GET & $_POST
2.) when dynamically creating HTML files (example below)
3.) logins & authentication in the same file as the form creator
4.) Sending e-mail with php

Yukarıdaki # 2

<?php
echo "<h1> Welcome </h1>";

if ($_SESSION['type'] == "admin")
{
//lots of html in the echo statment
echo "tables and admin interface here";
} else
{
//lots of html in the echo statment
echo "tables and user dashboard here";
}
?>

--VS--


<h1> Welcome </h1>

<?php
if ($_SESSION['type'] == "admin")
{
 ?>
lots of html in the echo statment    
tables and admin interface here 
<?php
} else
{
 ?>
lots of html in the echo statment    
ables and user dashboard here    
<?php
}
?>

--VS-- 

<?php if($_SESSION['username']): ?>

<p>You are logged in as <?=$_SESSION['username']?></p>

<p><a href="?logout=1">Logout</a></p>

<?php endif; ?>

ps: Thanks to everyone who already responded. Can I also inquire where does a framework fit? I took a class in OOP and we didn't become familiar with any frameworks.

Ben Symfony ve Zend çerçeveler çok okudum ama yine karıştı.

Tekrar teşekkürler.

0 Cevap