Hey guys, I hope everyone has had a great start to the new year. If you're just joining us, we're making hedgeclipper: a user log-in system. Last time, we outlined the basics of how hedgeclipper will work, and wrote a controller function for the whole thing. This time, we're going to focus on checking if the user is logged in or not. Before we start demanding a username and password, we're going to check if our user already logged in on a previous page visit. Have a look: ...
. Who Is This For? I'm going to make some assumptions about you, as a programmer: You're probably not an expert with PHP, but you know at least "the basics." If you're a copy+paste PHP coder, that's okay, but hopefully you won't be once we're done.You have some patience. Yes, you want to see results; but you can trust that they're coming.You're "okay" with doing things you've never tried before. There are some things I would like you to know ...
Updated 01-13-2013 at 11:30 PM by traq (added 'expiry' config option)
yes, I'm still doing the tutorial. : ) Did you know ...? PHP Code: <?php class alphaHeap extends SplHeap{ public function compare( $a,$b ){ return strcmp( $b,$a ); } } $alpha = new alphaHeap; # IN put: $alpha->insert( 'cat' ); // C $alpha->insert( 'dog' ); // D $alpha->insert( 'boy' ); // B $alpha->insert( 'elephant' ); // E ...
<?php class alphaHeap extends SplHeap{ public function compare( $a,$b ){ return strcmp( $b,$a ); } } $alpha = new alphaHeap; # IN put: $alpha->insert( 'cat' ); // C $alpha->insert( 'dog' ); // D $alpha->insert( 'boy' ); // B $alpha->insert( 'elephant' ); // E
Updated 12-23-2012 at 08:09 PM by traq
Yes, the tutorial is still coming. It's big. It's in progress. I read this recently and was intrigued. Don't know if anyone else would care or not ... The author, nikic, does a great job summarizing the difficulties and potential benefits of type hinting, as well as giving a good explanation as to why PHP's implementation is incomplete. Personally, I look forward to being able to type-hint any type. It could save me a lot of code validating args, and I could ...
Updated 12-01-2012 at 03:48 AM by traq
I wanted to take a few moments to talk about some of "the basics" that are all-to-often glossed over... A Matter of Style In general, I find that most PHP programmers fall into one of three main programming styles: procedural: a simple ordered set of instructions, nested if's/ else's, etc.functional: functions are little code containers that you can call on when needed. You [usually] give them arguments, they [usually] return values to you.object-oriented: ...
if
else
Updated 12-17-2012 at 02:49 AM by traq