Posts tagged php
Even MORE TYTC Goodness
1Just wanted to throw out another ‘Teach Yourself To Code’ (TYTC) resource which I found today on Hacker News:
Unclassroom, who are taking it to the next skill level by teaching PHP. As well, if you fill out their short survey, you will get a free credit towards one of their courses.
(Disclaimer: I am not affiliated with Unclassroom in any way, I just think that the TYTC movement is cool, and want to get as many resources out to people as I can.)
UPDATE: Krishna from Unclassroom has commented below and will extend anyone a one-time code for one of their classes, if you contact him directly at krishna@unclassroom.com and reference this blog posting.
MANY MANY thanks to Unclassroom for extending this offer.
FURTHER UPDATE: Unclassroom has provided me some promo codes. Please feel free to contact me directly for them.
That’s using your head…er()
0This is just a quick tip that I know has been demonstrated in other places, but it’s one that I have used frequently to provide an excellent solution to a variety of problems.
If you are using any kind of language on the back-end of your web application (PHP, Python, Ruby, Perl, etc) then you will eventually find yourself in the position of having to send different types of content. It may be XML, it may be a PDF file, it may be streaming video. Whenever you are in this situation, you need to change the Content-type that is sent back to the client. In PHP, you would do this with the header() function. In Python, it’s send_header() with the BasicHTTPServer. Ruby has various methods depending on whether or not it’s Rails or CGI, etc. Ultimately, your back-end code needs to designate to the client that something other than text/html is coming down the pipe.
The reason I think this is worth mentioning is because you can also designate a type that is just for JavaScript. This means that you can assemble your JavaScript dynamically on the server side, and have it get read by your browser just as if it was a .js file!
