4 ms·
Use PHP to build a Twitter-like system on your site
- BjornW 18y agoI haven't read the article in full, but I wonder why the author hasn't used laconi.ca (the free open source software which is used by identi.ca). Why should you be creating a new microblogging solution when a perfectly good open platform exists?
- ryanwaggoner 18y agoLearning.
- BjornW 18y agoInteresting. I would have given the same answer some time ago, yet lately I have the feeling that I learn more from installing, configure and dive into somebody else' code and extend / change it than writing something from scratch. I guess both are valid 'methods' to learn, although the latter benefits open source projects like laconi.ca as well.
- silencio 18y agoI personally think that both are valid methods to learn, but that you learn different things from going the separate ways. i.e. when I'm writing something from scratch I have to learn every little detail of what I'm trying to do, whereas taking a look at someone else's code I could gloss over a lot of the implementation details but learn how the author decided to implement some of the relevant/important parts, how to extend, and otherwise generally contribute to a project.
- mikeyur 18y agoWordpress is the complete blogging solution, or so I'm told. So why did I bother to code a CMS for myself from scratch? Because I wanted to learn and it better suited my needs.
- tjogin 18y agoThis is really insufficiently complex and/or interesting to belong here, is it not?
- helium 18y agoWell it's on the front page
- gearslips 18y agoAgreed.
- nir 18y agoPersonally I'd still take this kind of article any time over the "why [Twitter | Facebook | etc] is the [next Google | biggest failure ever]", "5 timeless principles for [ building startups | coding | marketing] I just thought of, having done it for almost a year now" or anything from TechCrunch & co.
- mikeyur 18y agoAgreed. I love articles that tell you how to build something from scratch, they always give me new ideas.
- Jem 18y agoIs it just me or is there a total lack of input validation? mysql_real_escape_string isn't going to protect you from code injection...
- jncraton 18y agoIt's not just you. They don't use htmlentities at all.
- jonursenbach 18y agohtmlentities() might help to protect you from SQL injection, but it won't do a damn thing against XSS attacks.
- jncraton 18y agoI'll admit that I'm no PHP expert, but I was under the impression that htmlentities prevented XSS by converting all special html characters to their equivalent html entity. If HTML entities works properly, and it is used properly, shouldn't it prevent XSS since an attacker who inputs something like <script>alert("xss")</script> would simply see the message displayed back to them instead of the browser actually executing it?
- jonursenbach 18y agoHmm, yeah you're right. I'm not sure what I was thinking of.
- mikeyur 18y agoI don't think the point of this article was to be a copy and paste twitter alternative, it's more to show that it's possible to do it (at least that's what I got out of it). There's also no hashing/salting of user passwords or anything. Even with some minor coding experience you should be able to pick this out.
- Jem 18y ago
- rbanffy 18y agoI only hope part #2 addresses the scalability problems #1 has before the site becomes a hit... ;-)
- tghw 18y agoHow about just installing laconica?
- callmeed 18y agoFirst, it's interesting that they call this an intermediate level tutorial/article. I'd definitely put a microblog in the begginer category (The "build a blog in 15 mins" screen cast is one of the first things people watch when getting into Rails). Second, in the time it took to write this article, one could have built the actual app to provide for download or as an open-source project.