Wednesday, December 16, 2009

Not engineering related.

And it's my second post since my hiatus!

Found this funny and had to share:

so I was with my friend bryan the other night in a bar
well he got really drunk and said he was gonna puke
so i helped him walk to the toilet
all the stalls were occupied
bryan is a rugby player... so a big guy
so he fucking KICKS one of the stall doors open
and there's this guy in there taking a shit
and bryan throws up ALL OVER HIM
then (this is genius) bryan thinks 'oh shit... if i were taking a shit and someone came in and was sick all over me, i'd want to fuck him up... so i'd better hit him first'
so he fucking SMACKS this guy in the face
and runs away
imagine being that guy... WORST NIGHT OUT EVER


Now something kinda engineering based...
Friend: are you familiar with how sessions work in php?
Friend: well basically you can store variables in sessions
Ed: yes
Friend: like $login = matt
Ed: yes
Friend: then u can retrieve it later
Ed: and $password=password
Friend: yea
Ed: but that's not a good idea
Ed: hahahaha
Friend: right
Friend: so, one of the guys was doing the login, and he gets an error "html headers already sent" or something or other. which means something was printed to the screen already so you can't do a redirect
Friend: so I told him, you have to put the redirect before anything is printed to the screen
Friend: make sense?
Ed: yes
Friend: so, he goes back to the top of the page and puts something like if(isset($_session['login']) { redirect } meaning if the session variable for login is set do the redirect
Friend: which is correct!
Friend: BUT
Friend: the processing that sets the session variable was in the code below that...
Friend: so he asks me 2 hrs later why it wont redirect...
Ed: wow.
Friend: and I just stood up and walked away from my computer without saying anything
Ed: HAHAHAHHAHAHA
Ed: oh god....
Friend: If I smoked, I would have went to take a smoke

No comments: