Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

TutsPlus.com:
How to Create a Slack Interface for Your PHP Application
Apr 21, 2016 @ 10:12:04

On the TutsPlus.com site they've posted a tutorial helping you connect your PHP application with Slack allowing for both the sending of content to your Slack channel(s) but also responding to "slash" commands.

If you've been following the development of office communication tools in the past year or so, I'm sure you've heard plenty about Slack. [...] As developers, we are in a good position to jump on the trend and think about ways we can use Slack as a chat-based user interface for our applications.

That's why, in this tutorial, you will learn how to get started with integrating your PHP application to Slack, by making it post messages to a Slack channel and respond to slash commands.

They start with a "bare bones" setup that will get you up and running and sending messages to your Slack instance. Their example takes in a string and sends it along through a custom Slack application. They walk you through the steps to create this application on the Slack side and this example code to make the connection and send the message. The tutorial walks you through all of the provided code and helps you get your OAuth credentials in place to secure the connection.

With this basic functionality in place you can then build on top of it and define "slash" commands that request a URL. Their example "tells a joke" in the channel making the request.

tagged: tutorial slack integration api slash command introduction

Link: http://code.tutsplus.com/tutorials/how-to-create-a-slack-interface-for-your-php-application--cms-25269

Allan MacGregor:
Exploring Hack: Building a MicroFramework
Aug 11, 2014 @ 09:09:13

Allan MacGregor has started a new series of posts to his site where he creates a microframework in Hack, the language created by Facebook to compliment their HHVM (Hip-Hip Virtual Machine) project. He sees it as a "learn by doing" kind of thing and wanted to share his results.

I honestly believe the best way to learn something is to get your hands dirty and make mistakes; so instead of writing dozens of post on the many new features of Hack and why they are awesome (in theory) let's build something useful. So to get started I've decided to build a micro-framework using HACK and HHVM, building a simple microframework should be a challenging enough task to illustrate some of the more interesting features of the language and at the same time it has an achievable goal so we don't end on a never ending development cycle.

His framework, one he calls "Slash", will mostly be about creating RESTful applications but it could, in theory, be for any kind of web application. He also mentions some of the other great microframeworks out there already that are well-developed and have good communities behind them (including Slim and Silex. This is just the first part of the series and introduces some of the "why" around his goal. In the next part of the series he'll get into the structure and routing with some actual framework code.

tagged: hack microframework facebook hhvm language slash

Link: http://coderoncode.com/2014/08/06/exploring-hack-part1.html

Gareth Heyes' Blog:
PHP self return of the slash
Sep 25, 2009 @ 10:31:24

In this new post to his blog Gareth Heyes points out a legacy issue that those running older PHP4-based code might want to look into:

I thought about something I found ages ago in PHP4 and it’s been long enough now. This is also quite funny because my server is vulnerable to this. So what happens if you escape PHP_SELF with htmlentities($_SERVER['PHP_SELF'], ENT_QUOTES)? Safe from XSS? I hope so. Safe from everything? Well not really or at least it didn’t used to be.

He gives a simple example of how the PHP_SELF issue can be used to change the form's target just by using a few well-placed slashes. Thankfully, this seems to be only back in the world of PHP4, so those working with PHP5 should be safe.

tagged: phpself xss vulnerability slash

Link: