Closed Thread Icon

Topic awaiting preservation: PHP Coding Standards (Ha ha) (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=29924" title="Pages that link to Topic awaiting preservation: PHP Coding Standards (Ha ha) (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: PHP Coding Standards (Ha ha) <span class="small">(Page 1 of 1)</span>\

 
rukuartic
Bipolar (III) Inmate

From: Curled up with a ... ...warm laptop?
Insane since: Jan 2007

posted posted 01-26-2008 17:52

Ye gods. I've been coding PHP for about a year now, and I've noticed there's more than forty ways to do any specific thing. I have to be doing something wrong.

Should I be generating all my dynamic content at the top of my script, and then outputting it through a template? Or should I just output my template and mash code in when I reach the area?

I have index.php with a switch in it, which will include different php files based on $_GET['go']. For example, /index.php?go=write will take me to a page where you can write a blog post. /index.php?go=edit will let you edit those posts... ...should I have separate pages for each of them? (index.php, write.php, edit.php)?

Right now, my login system seems to be so flimsy--to see if the user is logged in or not, it only checks to see if $_SESSION['username'] isn't null. Should I be using the isset() function, or can I just work with

code:
if($_SESSION['username'])



And... ...thats about all I can think of for now...

<? include("signature.php"); ?>

argo navis
Paranoid (IV) Inmate

From: Switzerland
Insane since: Jul 2007

posted posted 01-27-2008 19:27

Two tips :
- post descriptive titles relevant to the topic at hands. Here, you wonder about coding standards and then, you drop a concrete
question about a login system. Which one are we supposed to adress?
- Read The Funky Manual and do that quick,
your login system is a piece of swiss cheese, anything can pass through and you don't want that.

My 2 cents.

« BackwardsOnwards »

Show Forum Drop Down Menu