21 Comments
- Metal_Hurlant, on 10/12/2007, -0/+0a blurb of fundamentals about php and mysql that doesn't mention SQL injections and a 2 liners on how to avoid them, given how frequently they happen in that context, is not quite complete.
- LiquidRain, on 10/12/2007, -0/+0It could be argued "advanced fundamentals" could be object-oriented programming tips, like how to write Singleton classes in PHP, or some such/
- joshfraz, on 10/12/2007, -0/+0radicand, i think you will find that in general globals waste a lot more memory than local variables. we talked about it in my compiler class today.
- jesusphreak, on 10/12/2007, -0/+0To be perfectly honest, I wouldn't go looking for a solid foundation from a person who has only coded for a year.
- MellerTime, on 10/12/2007, -0/+0SQL injections, what are they? I thought it was INSERT, not INJECT...
</poor_nerdy_humor>
In all seriousness though, that's a pretty good list of things to keep in mind. For example, I always use the short PHP open tag ( - skidooer, on 10/12/2007, -0/+0"SQL injections, what are they? I thought it was INSERT, not INJECT..."
Image you had code like this:
$query = "SELECT * FROM table WHERE id = {$_GET['id']}";
Since there are no checks against the value of $_GET['id'], someone can set the value to:
"1; DELETE FROM table"
So, the query that is passed to the database is:
SELECT * FROM table WHERE id = 1; DELETE FROM table
I'm sure you can see where I'm going with this. - etruscan, on 10/12/2007, -0/+0I don't consider myself a very strong PHP programmer, but happily... I think I adhere to just about all these standards. w00t!
- MellerTime, on 10/12/2007, -0/+0And, it looks like Digg doesn't handle PHP tags very well in comments... I'm really too lazy to re-type the rest of that comment too... Poo on Digg!
- Sudar, on 10/12/2007, -0/+0Good Collection. But it's kind of outdated. It would be nice if some one could come up with some thing like this for PHP5.
digged - inactive, on 10/12/2007, -0/+0how do i make a scalable php based website?
- jared9985, on 10/12/2007, -0/+0Mar 25, 2002
O_O - msodrew, on 10/12/2007, -0/+0lol @ dracula...
pickup any php/mysql book (there are hundreds) and stick to standards, fasho. - quitter, on 10/12/2007, -0/+0Here's one tip I picked up: 'PHP is "typeless"'.
Reaching a consensus amongst posters does not necessarily produce good advice. What it does is propagate the repetition of information of dubious value often not understood by the posters in the first place.
If you're an inexperienced PHP coder: please source your tips from a book by one of the reputable tech publshers or an expert-reviewed website not some vBulletin board. - suneo, on 10/12/2007, -0/+0awesome stuff.
- pussyWagon, on 10/12/2007, -0/+0good digg, better bookmark.
Also it was posted in 2003.
Has anything changed for PHP 5? - shuffles, on 10/12/2007, -0/+0basic = noobs. But being the noob that I am, I dugg it!
- Metal_Hurlant, on 10/12/2007, -0/+0php 5 makes the language sucks less.
For example, doing
$a = new Object();
doesn't create an object, copy it, discard the first object, and assign the copy to $a anymore, which was brain-dead, to be polite.
It also has better/safer default settings. - alias1, on 10/12/2007, -0/+0
Mmm, PHP - molotov, on 10/12/2007, -2/+1Oh nice, "basic fundamentals" as opposed to what... "advanced FUNDAMENTALS"? One thing that sucks about Digg is that although stories are good, the headlines and the descriptions often suck.
- kenta, on 10/12/2007, -2/+0The problem with a post like this is that it doesn't solve your ongoing need to post those tips in the future. As your digg falls down the rankings, fewer people will find the tips. You'll either have to re-digg or continue providing tips.
Just my two cents
----------------------------------
http://www.MakeMeMortgageFree.com/


What is Digg?
Check out the new & improved