News Feed
Jobs Feed
Sections




News Archive
feed this:

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

SitePoint PHP Blog:
Social Network Style Posting with PHP, MongoDB and jQuery - part 2
November 19, 2013 @ 13:55:17

The SitePoint PHP blog has posted the second part of their series about the creation of a simple comment posting social site based on PHP, MongoDB and jQuery. In this second part they build on the structure from part one and add in posting and "liking".

In the previous part of the series, we explained the database architecture, post stream design and application flow required for developing our post mechanism wherein the user will be able to post a status, like/unlike other people's statuses and comment on them. This part of the series will drive you through the coding required to implement these functionalities. We will use the application flow and database structure as discussed in the last article. Don't forget to download the code from the github repo if you'd like to follow along.

First he shows you how to get new posts added to the database, POSTed to the backend PHP script. He also shows how to insert the contents back into the page and pull out the latest posts. Next up is the like/unlike-ing of the posts, handled by a simple submission to another backend script.

0 comments voice your opinion now!
tutorial mongodb social post jquery

Link: http://www.sitepoint.com/social-network-style-posting-php-mongodb-jquery-part-2/

SitePoint PHP Blog:
Social Network Style Posting with PHP, MongoDB and jQuery - part 1
November 15, 2013 @ 09:09:43

The SitePoint PHP blog has a new tutorial posted today kicking off a series about creating a "social network style posting" application that combines PHP, MongoDB and jQuery that feels similar to a nested commenting system you'd see on most social sites.

Post mechanisms similar to Facebook are nowadays very common within any application. The concept of Post-Like-Comment is familiar to everyone who ever used a social network. In this article, we will learn how to create a similar working model wherein the user will be able to post his status, like posts and comment on them. What's more interesting is that after learning things from this article, going forward you will be able to implement a lot of other features on your own.

In this first part of the series they start you off with the base code and introduce you to how the data is stored. They also walk you through how the "stream" part of the code works and the tracking of the current user. From there, there's a brief look at how to pull out the comments and display them to the page.

0 comments voice your opinion now!
social post tutorial mongodb jquery part1 series

Link: http://www.sitepoint.com/social-network-style-posting-php-mongodb-jquery-part-1/

SitePoint PHP Blog:
Handle Incoming Email with SendGrid
August 27, 2013 @ 10:30:34

On the SitePoint PHP blog today Lukas White has a new tutorial showing you how to handle incoming emails from SendGrid (well, pulled from SendGrid) and translate them into posts for your blog or site.

In this article, I'm going to look at how you might implement an email-to-post feature, using SendGrid. SendGrid is a service for sending email - usually in bulk, but they also offer a less well-publicized feature for handling incoming email. SendGrid can be configured to handle all incoming messages for a given domain by pinging a URI of your choosing, and by implementing a simple webhook, you can act on the incoming mail accordingly.

He bases the simple example off of the Slim framework, creating a structure with a basic database for users and posts. He then goes through the SendGrid interface, pointing out where you add the hostname and URL to call back when a new email comes in. He includes the code to create the callback functionality that accepts the POST request coming from SendGrid. This is then validated and inserted into the database to be pulled out later by the "posts" page. There's also a bit about saving images (or other files) that come in as attachments to the email.

0 comments voice your opinion now!
incoming email sendgrid callback post tutorial image attachment

Link: http://www.sitepoint.com/handle-incoming-email-with-sendgrid/

PHPMaster.com:
REST - Can You do More than Spell It? Part 1
April 30, 2012 @ 09:51:46

On the PHPMaster.com site there's a recent tutorial posted, the first part in a series of posts from David Shirey about building REST APIs in PHP. This first part of the series stays pretty high-level and really just introduces some common REST concepts.

Thousands of years ago when we first started building web pages, things were very simple. You'd put some text on the page, maybe even an image, and that was pretty much it. But today it's a whole different ball game. Instead of static pages there's the dynamic applications we've come to depend on. And so, how these applications are designed to communicate becomes very important. In this series I'll introduce you to the REST architecture style. In this article I'll help you to understand exactly what it is, and later I'll show you how it can be implemented in a PHP environment.

He defines the term "REST" for those not familiar and how a typical RESTful API allows other end users/software to interact directly with its data. He outlines some of the common principles of REST and finishes the post with a comparison of two HTTP verbs - PUT and POST.

0 comments voice your opinion now!
rest api webservice introduction put post


PHPMaster.com:
An Intro to Virtual Proxies, Part 1
April 19, 2012 @ 08:52:44

On PHPMaster.com today there's a new tutorial from Alejandro Gervasio about using virtual proxies in your application - a method in development that provides a layer of abstraction on top of domain objects and makes it more efficient to work with (and lazy load) them.

Often referenced by a few other fancy names, the substitute is generically called a virtual proxy, a sort of stand-in that exploits the neatness of Polymorphism and interacts with the actual domain objects. Proxies aren't new to PHP. Doctrine and Zend Framework 2.x make use of them, although with different aims. On behalf of a didactic cause, however, it would be pretty instructive to implement some custom proxy classes and use them for lazy-loading a few basic aggregates from the database, this way illustrating how virtual proxies do their stuff under the hood.

He starts off by setting up a domain model for a "Post" and "Author" - a typical blog example.Based on the definition of these classes, he creates a mapper class to generate Author objects and an "AuthorProxy" class that uses a "loadAuthor" method to only load in the author's details when a property is requested. He gives a bit more code showing it in action and the difference between using the normal Author and AuthorProxy class.

0 comments voice your opinion now!
virtual proxy tutorial blog author post interface


PHPMaster.com:
Building a Domain Model - An Introduction to Persistence Agnosticism
February 27, 2012 @ 12:58:00

On PHPMaster.com there's a recent tutorial introducing the concept of a "domain model" and showing how to create them in PHP (manually, not inside of any ORM or database solution).

First off, creating a rich Domain Model, where multiple domain objects with well-defined constraints and rules interact, can be a daunting task. Second, not only is it necessary to define from top to bottom the model itself, but it's also necessary to implement from scratch or reuse a mapping layer in order to move data back and forward between the persistence layer and the model in question.

They include an example of a set of domain models tat relate to one another - a blog setup with posts, comments and users. They show how to create the AbstractEntity to handle a bit of the magic behind the scenes, an example "Post" and "Comment" models and how they can be put to work creating some posts and appending comments. A little bit of markup is included to output the results.

0 comments voice your opinion now!
domain model relation tutorial blog post comment user


Lorna Mitchell's Blog:
Building A RESTful PHP Server Routing the Request
January 23, 2012 @ 11:14:11

Lorna Mitchell is back with a second installment in her "Building a RESTful PHP Server" series with this new post about handling and routing the incoming requests. (You can find the first part about working with the request here)

This is the second part of a series, showing how you might write a RESTful API using PHP. This part covers the routing, autoloading, and controller code for the service, and follows on from the first installment which showed how to parse the incoming request to get all the information you need.

She shows how to grab the controller name from the incoming request (based on her previous code), create the object for it and execute the requested action name. Also included is a sample autoloader and a basic controller - a UsersController with "getAction" and "postAction" methods for responding to GET and POST requests.

0 comments voice your opinion now!
restful server tutorial request routing controller get post action


Lorna Mitchell's Blog:
POSTing JSON Data With PHP cURL
November 22, 2011 @ 18:06:48

On her blog today Lorna Mitchell has a quick tip for anyone having an issue sending POSTed JSON data with the curl functionality that can be built into PHP. The trick to her method is sending things with the right header.

We can't send post fields, because we want to send JSON, not pretend to be a form (the merits of an API which accepts POST requests with data in form-format is an interesting debate). Instead, we create the correct JSON data, set that as the body of the POST request, and also set the headers correctly so that the server that receives this request will understand what we sent.

She includes a code example (about ten lines) showing the POSTing process that sets up options using curl's curl_setopt. Be sure to set up the headers to send as "application/json" - that's the trick to letting the remote end know the format.

0 comments voice your opinion now!
post data tutorial json curl curlsetopt


PHPBuilder.com:
Building RESTful APIs with the Slim Microframework
October 06, 2011 @ 10:12:07

On PHPBuilder.com today there's a new tutorial from Jason Gilmore about building a simple RESTful API with Slim, a microframework for PHP.

Although a relatively new entrant in the PHP framework sweepstakes, I've been lately quite intrigued by Slim, a slick RESTful microframework modeled after Ruby's Sinatra, which is coincidentally by far my favorite microframework available for any programming language. In this article I'll show you just how easy it is to get started building a powerful RESTful API using this streamlined framework.

Setup of the framework is as simple as downloading the latest copy from its github repository. It can then be included and used to make the simple routes in his examples. He uses a "games" request type to show how to handle GET, POST and PUT requests through Slim's simple interface.

1 comment voice your opinion now!
tutorial restful rest api slim microframework put get post


Web Development Blog:
How-to show popular posts on your WordPress blog?
November 17, 2010 @ 10:37:13

On the Web Development Blog there's a recent post that shows you how to, with a simple bit of code, pull out the most popular posts to your WordPress blog.

Since I'm using WordPress.com Stats, I would like to use the rankings generated by this service or plugin. Searching Google, I found some widget called "WordPress.com Stats: Top Posts Widget" which works out of the box (if like to use a widget). In my case I have a custom sidebar with different custom sections using custom code. The following example explains how-to use that code on your website.

WordPress, by default, doesn't track any statistic information about the posts on your site, so you'll need something like the WordPress Stats plugin to get that part working. Once that's there, you can use his code to pull out the posts from the last few days (configurable) and show the most popular of the list.

0 comments voice your opinion now!
wordpress mostpopular post plugin statistics



Community Events











Don't see your event here?
Let us know!


package introduction podcast performance unittest security hack opinion symfony2 facebook language install hhvm component framework database release overview application composer

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework