« first day (1019 days earlier)      last day (4155 days later) » 

21:00
@PeeHaa ah yeah, tried keeping up with what happens in here but some people kept distracting me. What do you want to put?
How do I set stream_context so that it sets gzip response header for all stream requests within a script? I just want to set/add that header to the current stream context. Also, is it effected by scope? Like if it's set inside a function or method it will be applied to other requests in the current script?
@Gordon I haze a homepage: pieterhordijk.com
@crypticツ You need to alter the default stream context, which is used whenever you don't explicitly pass one to a function that accepts one
@PeeHaa no responsive?
@crypticツ gzip response header in a request?! it's either a request or a response. But are you trying to fetch data from the SE API?
^^ create a stream context with the opts you want and pass it to that function
@Gordon from Github, just grabbing some raw text files which are Gzipped
The server won't (shouldn't) respond with gzipped content unless the request headers state that it is acceptable to do so
@DaveRandom it will only overwrite the options I set or it will empty out all options and then set with the ones I provide?
21:05
@peehaa i love the license...
@crypticツ is the problem decoding or requesting the resource gzipped
And if the default headers are such that the server responds with gzipped content, then PHP should transparently decode it
@igorw I might do that later. I first need to get at least something up there. However considering it took me almost two years to upload a frontpage I think it will be responsive after a year of 5 :)
@PeeHaa looks a lot like my private website ;)
lol
21:06
@DaveRandom yeah sorry I meant request header. I want to get the gzipped version served to me.
@Gordon xHTML, how retro
@crypticツ Ahh right, well then yeh all you need to do is alter the default stream context with the link above ^^
@igorw pffff
(Or use a proper HTTP client :-P)
@crypticツ Yeh it replaces the whole context, so you would overwrite the default opts. But IIRC the default is effectively empty anyway (i.e. all default)
XHTML ALL THE THINGS!!
4
21:08
But you can use php.net/manual/en/function.stream-context-get-default.php to get the default context and then set individual options on it
@crypticツ if I get you right, you can simply put Accept-Encoding: compress, gzip into the header field in the array you pass into stream_context_create
On a side note, a zip file will never be served gzipped? =oP Just want to make sure
Depends how intelligent the server is
It doesn't really matter though, PHP should transparently decode it either way so you will never have to ungzip it
@DaveRandom but it won't make a difference in size though so no reason to send accept-encoding header for such a file
> If no Accept-Encoding field is present in a request, the server MAY assume that the client will accept any content coding. - w3.org/Protocols/rfc2616/rfc2616-sec14.html
21:14
@Gordon Yes I know that, but read the next sentence ;-)
It so happens I've read the first few sections of chapter 14 in minute detail several times today, that's very fresh in my mind :-P
@crypticツ if you want to access GitHub, you could use a ready library: developer.github.com/v3/libraries
@DaveRandom next sentence?
> In this case, if "identity" is one of the available content-codings, then the server SHOULD use the "identity" content-coding, unless it has additional information that a different content-coding is meaningful to the client.
this?
user652649
evening
@Gordon I think @DaveRandom is refeing to prefered encoding to not fuck up old clients :)
jo @Wesツ
@Gordon Yes. So, in the context of a single request (and certainly a HTTP/1.0 request without a User-Agent header, as a PHP stream request would be by default) the response coding should always be identity (as in raw).
user652649
yo PeeHaa
21:21
@DaveRandom ah ok
However IIRC the SE API always returns gzipped content regardless of whether you asked for it or not (i.e. identity is not an available coding), I don't know if the same is true of github, it may quite possibly be
@DaveRandom yes, it does (SE)
Has anyone worked with html emails being sent from PHP?
I would imagine all of us
well, i am having trouble getting the plain text email to html email
21:24
swiftmailer.org <-- that's the biggest favour anyone can do you
even adding this does not work
 $headers .= "Content-type: text/html\r\n";
@EliteGamer pastebin your headers
@EliteGamer Smells like you are using mail(). Stop that immediately and go use swiftmailer
well, i only have two
@DaveRandom why?
21:25
@EliteGamer sanity
$headers .= "From: $email";
$headers .= "Content-type: text/html\r\n";
um, it works well
And where is the html and plain text content?
i do not see why not to use it
$body .= "<html><body>";
$body .= "<b>Name: </b>".$_REQUEST['name']." \n \n";
$body .= "<b>Email: </b>".$email." \n \n";
$body .= "<b>Description: </b>".$_REQUEST['desc']." \n \n";
$body .= "</html></body>";
@EliteGamer use swiftmailer...
@EliteGamer Because it deals with all this crap for you, you just give it the text content and the HTML content and it formats it into the insane format that is a modern email message and sends it through your chosen mechanism (I personally recommend "via an SMTP relay" but that's up to you)
21:27
hm
RFC822: It started badly and went downhill from there
@DaveRandom could you send me a link to that library
thanks
There's also that other one that people like, hang on let me find it
user895378
21:28
@DaveRandom That would be awesome. I've grown more and more frustrated with our lack of PHP HTTP functionality recently and I'm going to start toying with extensions as well.
i never used i library before :l
I prefer swift though
user652649
@DaveRandom with swiftmailer i was trying to connect to a smtp on a 3rd party host (host A connects on smtp of host B) but it didn't work... how's that possible since i connect to smtp with thunderbird for instance? any idea?
@DaveRandom I had the doubtful pleasure of writing a multipart email that would display in all webclients and outlook a few years back. that took a while. Mainly because of the sorry state of HTML mail though
@Wesツ What hosting platform? A lot of platforms just outright block port 25 and demand that you use their internal relay
That includes some VPS platforms, it's not just shared
user652649
21:29
two cpanels, not vps, regular hosting
And tbh, given that spam accounts for 15% of all internet traffic on a bad day, I have no problem with that
@DaveRandom where do i start?
move lib into my directory
?
@Gordon The real problem is Outlook. It was actually easier when the world ran on Office 2003 because it used IE to render instead of that piece of crap internal rendering engine it uses these days
@EliteGamer do you need that for massive newsletter sending or just the occasional email?
for a contact form
21:31
I hate thunderbird but at least the HTML rendering engine works properly
@EliteGamer ok, then go ahead
maybe 30 + - a day
@DaveRandom Oh yea, I thought IE was good for something...
@Gordon and use what?
@EliteGamer swiftmailer or Zend_Mail or anything that abstracts the dirty details for you (unless you want to learn them)
21:32
@Bracketworks I know, it's a sad day when you wish IE was rendering your HTML
@Bracketworks you won't believe it but Word renders HTML even crappier ;)
@Gordon can u help me install swift mailer
Zend_Mail that's the other one
@PeeHaa Oh, I know :-(
21:33
@EliteGamer It's definitely worth reading the book (as in the manual): swiftmailer.org/docs/introduction.html
I work in an Office 2Kwhatever environment, and whenever I get stuff to push to a website, it comes formatted in Word. I've tried a handful of times to produce damn-near HTML from the Word files. NOPE.
I know that's a lot to read, but email is a seriously complicated subject
nice, did not see that
@EliteGamer it has composer support
21:33
It's easier to copypaste it into plaintext, and reformat it by hand.
ah, ok
i thought that with mail()
you would just change the header
why will this not work?
@EliteGamer I don't support HTML mail
What now?
ha
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
this?
Also that thing you linked is vulnerable to header injection
@PeeHaa you get ignored. that's what's now ;)
21:36
@Gordon :)
@PeeHaa That's why it's CSSTricks and not PHPTricks.
God I hate those crap tutorial from people who have no F*&king clue
@Bracketworks At least 2k7+ format Office files are in something approaching an interoperable format, even if the document structure still sucks balls
interoperable my ass :P
Well to complicate things further, I think we're running 3 different versions across the company, since the rollout is well... s......l......o.....w......
21:37
Nooooooo I think I have to actually fix my footer now :(
@Bracketworks i stopped reading after s......l... - took too long
2003, 2007, and 2010. I have no idea what version of Exchange; probably several as well.
@PeeHaa display: none; fixes All The Things!
@Gordon and @DaveRandom in the PHP documentation ... php.net/manual/en/function.mail.php ... it shows where you can send the html email. Why will it not work for me?
21:38
@PeeHaa Why no one-box?
@EliteGamer it will work for you. it will just not work for us because we disabled html mail in our clients. so when you send us that mail, we cannot see it, because it's not multipart.
ha, nice
wait
nvm
@Bracketworks Moving gifs in here annoy me :)
Unless it is weekend and everybody is ot
21:40
@EliteGamer also note the note in the manual
> If intending to send HTML or otherwise Complex mails, it is recommended to use the PEAR package » PEAR::Mail_Mime.
@EliteGamer It will, if you want to go and learn how MIME works and how construct proper multipart messages, and then learn how modern spam filtering systems work and how to tweak the message headers and content in just the right way so that they won't eat them. Start here. Or... just use a library instead of trying to solve a solved problem ;-)
I'll remember that for the next time I want to annoy you ;-P
Recommending a pear package is like stabbing your best friend in the eye
6
:D
@Bracketworks :-)
@DaveRandom August 13, 1982, "You're a looong way from home, yuppie boy. I'll start a tab"
@PeeHaa it seems maintainend though
21:41
@DaveRandom Ha, ok
@PeeHaa A truer meme were never created
user895378
@PeeHaa Only if you're recommending it to your best friend. If you're offering it to someone you can't stand then it just feels awesome.
And then you throw in a bit of semantic HTML and it's the end of the world
@rdlowrey there are just some things you simply DON'T DO
user895378
lol. Friends don't let friends use PEAR.
21:42
hehehe
I'm going to start an internet self-help campaign I think, I can see the slogan now...
@Gordon I did the exact PHP tutorial, and it will not work.
> Do you use PEAR? You need to grow a pair.
ha
why would PHP even create a function that does not work
Friends don't let friends use PEAR.
user895378
21:46
ewww
@rdlowrey It's in better shape than the repo.
@EliteGamer It does work. It's just far too basic/low-level to be useful to the average user.
@Bracketworks whos the bees in that metaphor?
21:47
@Gordon Internals?
Are they bees or wasps?
@DaveRandom wasps. they have a waist
Is that how you tell?
!!find wasp nevermind, wrong room.
@DaveRandom good enough for me ;)
21:49
@DaveRandom what do i include?
lol howstuffworks.com has an article on it
there are multiple files
and a pretty rank picture :-S
While easily confused at a distance or without close observation, there are many different characteristics of common large bees and wasps which can be used to identify them. {| class="wikitable" ! rowspan="3" |   ! colspan="2" | Bees ! colspan="4" | Wasps (Family: Vespidae) |- ! Western honey bee ! Bumblebee ! Yellow Jacket ! Paper Wasp ! Bald-faced hornet ! Hornet (European hornet) |- | align="center" | | align="center" | | align="center" | | align="center" | | align="center" | | align="center" | |- ! Colors | Amber to brown translucent alternating with black stripes. ([http://...
It's all in the manual ;-)
21:50
@DaveRandom Aww man, my skin hurts just looking at that.
@Bracketworks hhhmmm I thought see was in here?
im off to bed. laters
@PeeHaa Wha?
sleep(GORDON)
hmmm nevermind. The bot got bored I think
21:52
@PeeHaa Ah. Yea, bots'll do that.
(wait, no they don't)
->setBody('Here is the message itself')

// And optionally an alternative body
->addPart('<q>Here is the message itself</q>', 'text/html')
what is the difference?
Well, I'm out too. Going home to continue work on my lexer which isn't working.
See you all later/tommorow.
later @Bracketworks. Lex that shit!
@EliteGamer When you send an HTML formatted message, it's good practice to include both a plain text and a HTML version of the same information. In general you set the first part of a multipart message to the plain text version, and then add the HTML as a following part
ah, ok
i am confused
why are there no commas
at the end of the code?
21:58
That's called method chaining and it sucks, because it causes people to ask questions like that
ha
so, am i on the right track here
$message = Swift_Message::newInstance()
->setSubject('Your subject')
Basically each method does return $this; at the end of it
ok, cool
So you can do $obj->method()->method(); and it's the same as $obj->method(); $obj->method();
The review queue tests are really rather poor. Each time I get one, I'll first be going "Ah, one of those tests again" and then I'll be looking more closely to see if I might be mistaken (not that I ever have been, but it's good to be thorough)
21:59
@Jasper Good, then you're not the people the tests target.
@Charles The thing is, the tests seem to be rather disconnected from reality, since you can easily tell them apart from real edits
@Jasper The scary thing being that people still fail them.
@Charles truly? That's rather scary indeed
@DaveRandom how do i send the email?
or does it send when i call that?
@EliteGamer Can't you just open the docs yourself instead of asking @DaveRandom to fetch the url for you?
22:04
i did
So what is the question?
i have this, but where is the send method?
$message = Swift_Message::newInstance()
->setSubject($_REQUEST['subject'])
->setFrom($email)
->setTo($EmailSwitch)
->setBody("Name: ".$_REQUEST['name']." \n \nEmail: ".$email." \n \nDescription: ".$_REQUEST['desc']." \n \n")
->addPart("<html><body><b>Name: </b>".$_REQUEST['name']." \n \n<b>Email: </b>".$email." \n \n<b>Description: </b>".$_REQUEST['desc']." \n \n</body></html>", "text/html");
Where do the docs say the send method is?
let me look some more....ohhh
i was in the message creating part of the docs
(facepalm)
just found this on amazon and its free for today not sure if its a good app, but it might be useful to some
22:13
@Class lrn2commandline nub
A shell was good enough for me, it's good enough for you! GET OFF MY LAWN!
> I tried all night! But I couldn't get past level 2. And you'd think that a game called SQUEAL would have more pig sounds.
I love Amazon reviews
lol
begining to hate SO now...
sick of giving quality answers, only to be beaten to the punch by a C+P of some code with no explaination
The better answer usually does get more upvotes in the medium-long term
getting none at all
Anonymous
22:23
@PeeHaa "Monitors you servers for you"?
@bizzehdee One of the biggest problems is the quality of the questions. If you are repwhoring on crap questions it's somewhat pot-luck.
And I use the word "rewhoring" in the nicest possible way, it's fine to help out people if you want to, just don't be surprised if that rep gets eaten by the review system ;-)
im repwhoring to try and hit 3k
@Simon_eQ meh typos all over the place
once im at 3k i can vote cv's
@Simon_eQ fixed tnx
Anonymous
22:26
@PeeHaa Nice. Cool site btw: I like the colors. I hope you don't have patent rights for #8c8989 :p
@bizzehdee Yeh like I say, I don't really have a problem with it, especially not for <10K users
@Simon_eQ All yours :)
Some properly epic fails in this question
user=$_POST['user'];
$password=$_POST['password'];


//To ensure that none of the fields are blank when submitting the form if
if(isset($_POST['user']) && isset($_POST['password']))
    {


$user = stripslashes($user);
$password = stripslashes($password);

$db1=new dbclass();
$db1->openDB();
$sql="SELECT * FROM users WHERE username='{$user}' AND password='{$password}'";
so.... "?user=' = OR 1=1 LIMIT 0,1 ---"...
I particularly like the stripslashes()
That's someone who read about the wrong way to do things and somehow managed to do that wrong
22:32
Somehow I expect that code at one point referenced $HTTP_POST_DATA instead of $_POST...
Also the use of the $_POST vars before the isset() check
@PeeHaa what's that little github flair-widgety type thing?
Also, I think GitHub just picks the third language at random
Nopez I have the php-src in my repo list
The third one show on my profile is awk. I don't think I've written any awk for at least 4 years, and I can't remember any of it
btw, @DaveRandom, took the little lad to the park yesterday. took him out of the pram and he just bolted for the slide, tripped over, landed on the edge of the slide on the top of his cheek bone
has a big black eye now
@DaveRandom lol
22:36
@PeeHaa Awesome
I was about to write a service for it myself, but thought I would first do a quick search :)
@EliteGamer Hi!
@bizzehdee Bad skills. Mine currently has a pretty rank looking injury on his knee that I'm starting to think may have gravel embedded in it somewhere. It doesn't seem to bother him though...
Fuck I think I have been rate limited by github
/me boooooos
@PeeHaa I think the styles on it could use a little work tbh, it's not quite as slick as the SE flair images somehow
user895378
22:39
@PeeHaa must be that garbage http client you're using :)
@DaveRandom: ouch, but same, he cryed at first, but after a few minutes, didnt seem to mind that one side of his face was twice the size it should be and purple
be using Artax, be using Artax...
@DaveRandom SE flair sucks. The suckers don't even support SSL/TSL. And I'm not going to jump to hoops to proxy the thing...
:)
user895378
@DaveRandom lol that's why I said it -- I just assumed it was
@rdlowrey I wouldn't dare to say anything bad about Artax :) In the last two days I have been using it for two different projects and it works awesomesauce
:-)
goddamnit
ow wait
no
try to get the SO one
Hmmmm. I feel a meta request coming up
@DaveRandom: btw, we have an inter-office 5-a-side match on friday morning, and we have phill clarke commentating it for us :D
If they are to fucking cheap to get another cert they could provide a way to use the SE one with parameters to only get the SO one
22:46
@PeeHaa I imagine there already is one, it's all the same server farm
in Tavern on the Meta on Meta Stack Overflow Chat, 10 secs ago, by David X. Random
We (the collective) would like to know if there's a way to get the SO flair image via stackexchange.com so it can be retrieved via HTTPS?
I couldn't find it and the SO one redirects to http :|
Shog or balpha will know I'm sure
@bizzehdee I don't actually know who that is :-P
wow. github rate limits to 60 requests per hour without a key :|
pussies
@DaveRandom: rugby super league commentator
user895378
@PeeHaa That is weak
22:51
God damn it all the mods who hang around in chat are not currently hanging around in chat, it might have to be a real meta question
Maybe we should yell in there that it is urgent?
in Tavern on the Meta on Meta Stack Overflow Chat, 2 hours ago, by Jeremy Banks
If anyone else would like to try (API key and access_token required), go to https://api.stackexchange.com/docs/create-comment and put the following JS in your console to set it up for /2.2/questions/{id}/answers/add. (I suggest id=3122 on MSO, the sandbox.)
Looks like the stack API 2.2 is imminent :-D
@PeeHaa That's a good point, I have't yet mentioned that it doesn't working either
@DaveRandom that would be cool
@DaveRandom lol
23:07
laters @CarrieKendall
user652649
23:36
i hate twitter... why don't they increase the *#ç@ number of characters
@Wesツ I would much rather deal with that instead of:
> No submodule mapping found in .gitmodules for path 'vendor/MarkDownRewritten'
Hi Guys. Does anyone know how to hide this error in php?:
"The Image cannot be displayed because it contains errors"
@Someone Stop emitting images that aren't images and the error will go away. Your image generation code is probably throwing warnings.
user652649
@PeeHaa i'd have committed suicide if i were you xD
@Wesツ I think I may have screwed something up myself. Just not sure what it is which is bad because I am about to delete the thing and try again and possibly make the same mistake again :P
23:44
@Charles the code works perfect: it creates image and moves it the specified folder. But it gives error. I just want to hide this error
@Someone If the code was working perfectly then you would not be seeing the error. The error indicates that the image file being viewed is ill-formatted.
user652649
@PeeHaa for me git is a mystery, pretty much like the meaning of life
2
@Wesツ ^^^^^^^^^^^^^^^^^^^^^^
user652649
and, the man that made the github windows client was obviously drunk
@Wesツ on what exactly?
;)
23:48
@Wesツ I thought it looked pretty nice. Totally useless, but nice :)
user652649
@JABFreeware nitromethane?
@Wesツ sounds about right
@Wesツ gui or msysgit?
@Wesツ what is that?
user652649
23:54
the proof that drugs aren't healthy
@Wesツ ah yes, I was reading git, but you wrote github client. Either way, just use msysgit. It's a good command line git for windows. It's better if you know unix a bit, but still good if you don't
user652649
@Jasper for sure i would prefer the most annoying and pedantic command line tool over that utterly insane gui
@Wesツ I know, I hate the Windows desktop too =oP
user652649
lol
@PeeHaa so there was no way to do the zip thing without saving file. can it be done with a .gz file? Also what would the impact be if say the file was say 1MB?

« first day (1019 days earlier)      last day (4155 days later) »