<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Tue, 21 May 2013 17:46:20 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Lorna Mitchell's Blog: Accessing Incoming PUT Data from PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/10728</guid>
      <link>http://www.phpdeveloper.org/news/10728</link>
      <description><![CDATA[<p>
For a recent REST web service project, <i>Lorna Mitchell</i> had to put together a server for the remote clients to use. She started with a GET request then moved to handling a POST request then to a PUT request - that's where <a href="http://www.lornajane.net/posts/2008/Accessing-Incoming-PUT-Data-from-PHP">the difficulty came in</a>:
</p>
<blockquote>
PHP doesn't have a built-in way to do this, and at first I was a little confused as to how I could reach this information. It turns out that this can be read from the incoming stream to PHP, php://input.
</blockquote>
<p>
Pulling from that stream gave her the raw data she needed (nicely urlencoded too) that she could parse out and use. She includes a simple example that has a check for the REQUEST_TYPE in the _SERVER superglobal to see how the request should be handled (PUT versus GET).
</p>]]></description>
      <pubDate>Thu, 31 Jul 2008 12:05:35 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Validating Incoming Data by Using Polymorphism with Objects in PHP 5]]></title>
      <guid>http://www.phpdeveloper.org/news/7571</guid>
      <link>http://www.phpdeveloper.org/news/7571</link>
      <description><![CDATA[<p>
DevShed has <a href="http://www.devshed.com/c/a/PHP/Validating-Incoming-Data-by-Using-Polymorphism-with-Objects-in-PHP-5/">posted the final part</a> of their look at using polymorphism with objects in PHP5, this time with a focus on validating incoming data from a form.
</p>
<blockquote>
In this final installment of the series I'm going to show you how to develop an expandable PHP mechanism for validating different types of incoming data. This will demonstrate how this important pillar of object-oriented programming can be used with a plethora of applications.
</blockquote>
<p>
They <a href="http://www.devshed.com/c/a/PHP/Validating-Incoming-Data-by-Using-Polymorphism-with-Objects-in-PHP-5/1/">show how</a> to create a simple DataValidator class to act as a base to build from. On top of this, they create classes to validate if the value is:
<ul>
<li>empty
<li>an integer
<li>if it's numeric
<li>if it's in a certain range
<li>if it's alphanumeric
<li>if it's alphabetic
<li>or if it's a valid email address
</ul>
They also include how to implement these filters, showing a simple Factory pattern that creates the object and runs the value through its validation.
</p>]]></description>
      <pubDate>Thu, 05 Apr 2007 10:56:00 -0500</pubDate>
    </item>
  </channel>
</rss>
