<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mental Masturbation, Musings, and Methods &#187; PHP</title>
	<atom:link href="http://blog.alexbeutel.com/category/programming/php-programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.alexbeutel.com</link>
	<description>The Mind of Alex Beutel</description>
	<lastBuildDate>Mon, 02 Aug 2010 06:20:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>SQL Injection at Duke TechExpo 2009</title>
		<link>http://blog.alexbeutel.com/265/sql-injection-at-duke-techexpo-2009/</link>
		<comments>http://blog.alexbeutel.com/265/sql-injection-at-duke-techexpo-2009/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 19:56:07 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Duke]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://blog.ambmediadesign.com/?p=265</guid>
		<description><![CDATA[I gave my first public talk today at Duke&#8217;s TechExpo 2009. I along with my coworker Artem Kazantsev discussed the risks of SQL Injection. The presentation gives a good overview of the capabilities of SQL injection along with how to prevent such vulnerabilities. I also gave a demo of performing a SQL injection attack on [...]]]></description>
			<content:encoded><![CDATA[<p>I gave my first public talk today at <a href="http://techexpo.oit.duke.edu/" target="_blank">Duke&#8217;s TechExpo 2009</a>.  I along with my coworker Artem Kazantsev discussed the risks of SQL Injection.  The presentation gives a good overview of the capabilities of SQL injection along with how to prevent such vulnerabilities.  I also gave a demo of performing a SQL injection attack on a vulnerable site during the talk.  For any web programmers who aren&#8217;t familiar with SQL injection, take a look at the code for the demo to see exactly how and why it is vulnerable, along with how to fix these vulnerabilities.</p>
<p><a href="http://ambmediadesign.com/SQLInjection.pdf">SQL Injection Presentation</a></p>
<p><a href="http://ambmediadesign.com/SQLInjectionDemo.zip">SQL Injection Demo</a></p>
<p>Additionally, earlier in the year I worked with Duke&#8217;s ITSO to write up examples of good coding practices to protect against a variety of web application security issues.  This referenced is linked on Duke ITSO&#8217;s site here: <a href="http://www.security.duke.edu/ITSO_Web_Application_Security_Standard_v1.pdf">http://www.security.duke.edu/ITSO_Web_Application_Security_Standard_v1.pdf</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexbeutel.com/265/sql-injection-at-duke-techexpo-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP and Acrobat.com</title>
		<link>http://blog.alexbeutel.com/13/php-and-acrobatcom/</link>
		<comments>http://blog.alexbeutel.com/13/php-and-acrobatcom/#comments</comments>
		<pubDate>Fri, 06 Jun 2008 01:36:46 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Acrobat]]></category>
		<category><![CDATA[Adobe]]></category>

		<guid isPermaLink="false">http://blog.ambmediadesign.com/?p=13</guid>
		<description><![CDATA[A good while ago I heard about Adobe acquiring Buzzword, which was quite exciting since it definitely seemed like the most clean of the up and coming online document editing software.  Finally, just last week Adobe released a public beta of a suite of Buzzword, Share, and other online editing tools to go along with [...]]]></description>
			<content:encoded><![CDATA[<p>A good while ago I heard about Adobe acquiring Buzzword, which was quite exciting since it definitely seemed like the most clean of the up and coming online document editing software.  Finally, just last week Adobe released a public beta of a suite of Buzzword, Share, and other online editing tools to go along with their release of Adobe Acrobat 9.  So, of course, I signed up, played around a bit before going to work in the morning and took a quick peek at the Share API.  Well to jump to the point,  I am excited at the possibilities but disappointed in Adobe.  For a company that is usually solid in their product releases, this is <em>very</em> beta.  As I read in another blog post, there is no continuity to the suite.  As a matter of fact, why is it even a suite?  The multiple features available at <a href="http://acrobat.com" target="_blank">Acrobat.com</a> should be implemented together.  And, rather than worrying so much about their value, open the features up more.  5 PDFs per month?  Really?  Anybody that can use Google can find infinite other ways to convert their documents to PDF.  My final complaint is that the flash viewer used to share the documents is atrocious.  It is impossible to actually read any documents with it.  Adobe has beautiful flash paper and again by trying to retain value will just kill itself off in the face of newer compartively open formats like Scribd&#8217;s iPaper (just a hack of Flashpaper but at least more accessible conversion).</p>
<p>Anyway, regardless of the poor GUI congruity, I would like to discuss the API.  The <a href="http://learn.adobe.com/wiki/display/acds/D.+Public+Libraries" target="_blank">site</a> has a few public libraries at first appearance, and I must hand it to Adobe that their Java library looks extremely clean and easy to use.  But the Python library &#8211; not even a library, although probably the easiest reading of all of their online documentation.  The writer of the blog even states that he has given up and decided to use the Java library -  encouraging.  Anyway, disappointed in not even an attempt at a PHP implementation, I decided to give it a shot.  I essentially went as far as the writer of the Python blog post: authenticate, get sessionid, and get a list of files you have on your account.  (Note this requires PEAR&#8217;s HTTP_Request package.)  Also, I know this is very ugly code and I&#8217;m possitive could and should be done much cleaner.  However, it works if your just trying to take the first steps and get some output.  If anyone wants to clean it up or continue on with a PHP implementation, feel free and let me know how it goes.  However, until they open up the platform to worthwhile features, it is sadly not worth my time.  Hopefully Adobe soon realizes the mistake of being so possessive and thinks a little more creatively about how to monetize their technology.  Anyway, here is the code; enjoy:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p13code2'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p132"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
</pre></td><td class="code" id="p13code2"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span> ?php
<span style="color: #000088;">$acrobat_api_key</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$acrobat_shared_secret</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$acrobat_base_url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;https://api.share.acrobat.com/webservices/api/v1/&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$acrobat_username</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;your_username@somecompany.com&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$acrobat_password</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;your_acrobat.com_password&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> getAuthToken<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$acrobat_api_key</span><span style="color: #339933;">,</span> <span style="color: #000088;">$acrobat_shared_secret</span><span style="color: #339933;">,</span> <span style="color: #000088;">$acrobat_base_url</span><span style="color: #339933;">,</span> <span style="color: #000088;">$acrobat_password</span><span style="color: #339933;">,</span> <span style="color: #000088;">$acrobat_username</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$a</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #990000;">HTTP_Request</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$a</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setURL</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$acrobat_base_url</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;auth/&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$a</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setMethod</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;POST&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$time</span> <span style="color: #339933;">=</span> <span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;POST https://api.share.acrobat.com/webservices/api/v1/auth/ &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$time</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$md5</span> <span style="color: #339933;">=</span> <span style="color: #990000;">md5</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #339933;">.</span><span style="color: #000088;">$acrobat_shared_secret</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$auth</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;AdobeAuth apikey=<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$acrobat_api_key</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>,data=<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$data</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>,sig=<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$md5</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$request_body</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;request&gt;<span style="color: #000099; font-weight: bold;">\n</span>&lt;username&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$acrobat_username</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/username&gt;<span style="color: #000099; font-weight: bold;">\n</span>&lt;password&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$acrobat_password</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/password&gt;<span style="color: #000099; font-weight: bold;">\n</span>&lt;/request&gt;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$a</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addHeader</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Authorization&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$auth</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$a</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setBody</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$request_body</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$a</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sendRequest</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$xml</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$a</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getResponseBody</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$regex</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;authtoken&gt;[a-zA-Z0-9]+&lt;/authtoken&gt;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #990000;">ereg</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$regex</span><span style="color: #339933;">,</span> <span style="color: #000088;">$xml</span><span style="color: #339933;">,</span> <span style="color: #000088;">$matches</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$p</span> <span style="color: #339933;">=</span> <span style="color: #990000;">xml_parser_create</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #990000;">xml_parse_into_struct</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$p</span><span style="color: #339933;">,</span> <span style="color: #000088;">$matches</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$vals</span><span style="color: #339933;">,</span> <span style="color: #000088;">$index</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$j</span> <span style="color: #339933;">=</span> <span style="color: #990000;">xml_parser_free</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$p</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$vals</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'value'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">function</span> getSession<span style="color: #009900;">&#40;</span><span style="color: #000088;">$auth_token</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$acrobat_api_key</span><span style="color: #339933;">,</span> <span style="color: #000088;">$acrobat_shared_secret</span><span style="color: #339933;">,</span> <span style="color: #000088;">$acrobat_base_url</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$a</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #990000;">HTTP_Request</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$a</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setURL</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$acrobat_base_url</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;sessions/&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$a</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setMethod</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;POST&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$time</span> <span style="color: #339933;">=</span> <span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;POST https://api.share.acrobat.com/webservices/api/v1/sessions/ &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$time</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$md5</span> <span style="color: #339933;">=</span> <span style="color: #990000;">md5</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #339933;">.</span><span style="color: #000088;">$acrobat_shared_secret</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$auth</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;AdobeAuth apikey=<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$acrobat_api_key</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>,data=<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$data</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>,sig=<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$md5</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$request_body</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;request&gt;<span style="color: #000099; font-weight: bold;">\n</span>&lt;authtoken&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$auth_token</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/authtoken&gt;<span style="color: #000099; font-weight: bold;">\n</span>&lt;/request&gt;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$a</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addHeader</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Authorization&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$auth</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$a</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setBody</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$request_body</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$a</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sendRequest</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$xml</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$a</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getResponseBody</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$regex</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;sessionid&gt;[a-zA-Z0-9]+&lt;/sessionid&gt;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #990000;">ereg</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$regex</span><span style="color: #339933;">,</span> <span style="color: #000088;">$xml</span><span style="color: #339933;">,</span> <span style="color: #000088;">$matches</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$p</span> <span style="color: #339933;">=</span> <span style="color: #990000;">xml_parser_create</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #990000;">xml_parse_into_struct</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$p</span><span style="color: #339933;">,</span> <span style="color: #000088;">$matches</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$vals</span><span style="color: #339933;">,</span> <span style="color: #000088;">$index</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$j</span> <span style="color: #339933;">=</span> <span style="color: #990000;">xml_parser_free</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$p</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$regex</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;secret&gt;[a-zA-Z0-9]+&lt;/secret&gt;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #990000;">ereg</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$regex</span><span style="color: #339933;">,</span> <span style="color: #000088;">$xml</span><span style="color: #339933;">,</span> <span style="color: #000088;">$matches2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$p</span> <span style="color: #339933;">=</span> <span style="color: #990000;">xml_parser_create</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #990000;">xml_parse_into_struct</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$p</span><span style="color: #339933;">,</span> <span style="color: #000088;">$matches2</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$vals2</span><span style="color: #339933;">,</span> <span style="color: #000088;">$index</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$j</span> <span style="color: #339933;">=</span> <span style="color: #990000;">xml_parser_free</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$p</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$response</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$vals</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'value'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$response</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$vals2</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'value'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">return</span>  <span style="color: #000088;">$response</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">function</span> getList<span style="color: #009900;">&#40;</span><span style="color: #000088;">$session</span><span style="color: #339933;">,</span> <span style="color: #000088;">$secret</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$acrobat_api_key</span><span style="color: #339933;">,</span> <span style="color: #000088;">$acrobat_shared_secret</span><span style="color: #339933;">,</span> <span style="color: #000088;">$acrobat_base_url</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$a</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #990000;">HTTP_Request</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$a</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setMethod</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;GET&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$time</span> <span style="color: #339933;">=</span> <span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;GET /webservices/api/v1/dc/ apikey=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$acrobat_api_key</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; calltime=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$time</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; sessionid=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$session</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$md5</span> <span style="color: #339933;">=</span> <span style="color: #990000;">md5</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #339933;">.</span><span style="color: #000088;">$secret</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$acrobat_base_url</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;dc/?apikey=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$acrobat_api_key</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&amp;calltime=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$time</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&amp;sessionid=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$session</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&amp;sig=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$md5</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$a</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setURL</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$a</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sendRequest</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$xml</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$a</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getResponseBody</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$xml</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000088;">$auth</span> <span style="color: #339933;">=</span> getAuthToken<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> getSession<span style="color: #009900;">&#40;</span><span style="color: #000088;">$auth</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$session</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$secret</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> getList<span style="color: #009900;">&#40;</span><span style="color: #000088;">$session</span><span style="color: #339933;">,</span> <span style="color: #000088;">$secret</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.alexbeutel.com/13/php-and-acrobatcom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
