<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1021004" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1021004</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-file-access#comment-1130043</link>
    <description> &lt;p&gt;Mark, I don&#039;t have VB installed, it needed some other files in order to install.&lt;/p&gt;
&lt;p&gt;I&#039;m now linking to the query PHP page from another PHP page (instead of the .swf) because &#039;referer&#039; was returning null. &lt;/p&gt;
&lt;p&gt;Can I add some more security to this script, I read &#039;referer&#039; can be easily spoofed. &lt;/p&gt;
&lt;p&gt;?&amp;gt;&lt;br /&gt;
$ref = $HTTP_SERVER_VARS[&#039;HTTP_REFERER&#039;];&lt;/p&gt;
&lt;p&gt;if ($ref== &quot;currentScript.php&quot;){&lt;br /&gt;
    &#039;executeQuery()&#039;&lt;br /&gt;
} else {&lt;br /&gt;
    die (&quot;no access&quot;);&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;TonyMontana&lt;br /&gt;
&lt;img src=&quot;http://www.electricmountain.com/meth2.jpg&quot; alt=&quot;&quot; class=&quot;bb-image&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Sat, 26 Apr 2003 03:08:30 +0000</pubDate>
 <dc:creator>TonyMontana</dc:creator>
 <guid isPermaLink="false">comment 1130043 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-file-access#comment-1129990</link>
    <description> &lt;p&gt;Third option... you&#039;ll have to open a socket connection to the server, and send that out.  Then listen for the reply (HTTP Response).  This is more difficult option, but for some projects, it offers so many options.&lt;/p&gt;
&lt;p&gt;To find the User-Agent, ehhhh...  I can&#039;t think of anything creative with PHP right now, so I&#039;ll use an old tool.  Download this: &lt;a href=&quot;http://host.maxalbert.com/twf/TCP_receiver.exe&quot; class=&quot;bb-url&quot;&gt;http://host.maxalbert.com/twf/TCP_receiver.exe&lt;/a&gt; (24KB)&lt;/p&gt;
&lt;p&gt;I know it&#039;s not pretty.  I made it to debug some applications I was making.  But it still works.  I think it requires the VB6 runtime, but I never made an installer for it.&lt;/p&gt;
&lt;p&gt;o Make a flash script open a file at: &lt;a href=&quot;http://127.0.0.1:80/example.html&quot; class=&quot;bb-url&quot;&gt;http://127.0.0.1:80/example.html&lt;/a&gt;&lt;br /&gt;
o Run the TCP_receiver.exe.&lt;br /&gt;
o Change to port to whatever you want (80 used above) and click Apply.&lt;br /&gt;
o Run your flash script.&lt;br /&gt;
o TCP_receiver.exe should now contain the HTTP Request from the Flash script (which will probably die waiting for a reply).&lt;/p&gt;
&lt;p&gt;If you get anything, post it.  I&#039;d be very interested in seeing what Flash says.  The line of dashes is just to seperate stuff.  It&#039;s not sent by anything.&lt;/p&gt;
 </description>
     <pubDate>Fri, 25 Apr 2003 10:05:56 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1129990 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-file-access#comment-1129983</link>
    <description> &lt;p&gt;In the third option, where would this code be placed:&lt;/p&gt;
&lt;p&gt;GET /contentEngine.php HTTP/1.1&lt;br /&gt;
Connection: Keep-Alive&lt;br /&gt;
User-Agent: super secret script&lt;br /&gt;
Accept: */*&lt;br /&gt;
Accept-Language: en&lt;br /&gt;
Accept-Charset: iso-8859-1,*,utf-8&lt;br /&gt;
My-Header: My-Value&lt;/p&gt;
&lt;p&gt;And in the first option, how can I find out the value of the User-Agent header?&lt;/p&gt;
&lt;p&gt;Flash unfortunately has little in the way of encryption/decryption and all strings/passwords within an .swf file can be easily viewed in an actionscript decompiler.&lt;/p&gt;
 </description>
     <pubDate>Fri, 25 Apr 2003 04:53:11 +0000</pubDate>
 <dc:creator>TonyMontana</dc:creator>
 <guid isPermaLink="false">comment 1129983 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-file-access#comment-1129896</link>
    <description> &lt;p&gt;Well, the only way I know to protect the file is by using some kind of checks.  I&#039;m not familiar with Flash MX, so I&#039;ll try to provide as many general options as possible.&lt;/p&gt;
&lt;p&gt;Option One&lt;br /&gt;
Find out what the value of the User-Agent header is.  If it identifies flash, this would be great to use.  If there is a User-Agent, you could use .htaccess to protect the directory/file.  Or some PHP like:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;if (!&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;preg_match&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;/flash/i\&quot;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_SERVER&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;HTTP_USER_AGENT&#039;])) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; die(\&quot;quit hacking\&quot;);&lt;br /&gt;}&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Option Two:&lt;br /&gt;
I believe you tell Flash which URL to retrieve.  So you might append a key or password to this.  Such as &quot;contentEngine.php?whoami=super_secret_script&quot;.&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;if (!&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_GET&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;whoami&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]!=&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;super_secret_script&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; die(\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;quit hacking\&quot;);&lt;br /&gt;}&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Option Three:&lt;br /&gt;
If possible, you might add some custom headers to the HTTP Request.  A basic HTTP Request looks like this:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;GET /contentEngine.php HTTP/1.1&lt;br /&gt;Connection: Keep-Alive&lt;br /&gt;User-Agent: Mozilla/4.02 [en] (X11; I; SunOS 5.4 sun4m)&lt;br /&gt;Accept: image/gif, image/x-bitmap, image/jpeg, image/pjpeg, */*&lt;br /&gt;Accept-Language: en&lt;br /&gt;Accept-Charset: iso-8859-1,*,utf-8&lt;/code&gt;&lt;/div&gt;&#039;&lt;br /&gt;
But you could become a creative artist and...&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;GET /contentEngine.php HTTP/1.1&lt;br /&gt;Connection: Keep-Alive&lt;br /&gt;User-Agent: super secret script&lt;br /&gt;Accept: */*&lt;br /&gt;Accept-Language: en&lt;br /&gt;Accept-Charset: iso-8859-1,*,utf-8&lt;br /&gt;My-Header: My-Value&lt;/code&gt;&lt;/div&gt;&#039;&lt;br /&gt;
Then...&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;if (!&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_SERVER&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;User-Agent&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]!=&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;super secret script&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;|| &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_SERVER&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;My-Header&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]!=&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;My-Value&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; die(\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;quit hacking\&quot;);&lt;br /&gt;}&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;You may also consider encrypting your data.  I don&#039;t know what decyption options Flash has, so you&#039;ll have to research that.&lt;/p&gt;
 </description>
     <pubDate>Wed, 23 Apr 2003 23:16:25 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1129896 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-file-access#comment-1129858</link>
    <description> &lt;p&gt;&quot;Or just make what your passing unreadable (or backwards) on=off, left=right, north=east ... just be sure to write it down or you&#039;ll confuse yourself&quot;&lt;/p&gt;
&lt;p&gt;  Do you have an example of this? &lt;/p&gt;
&lt;p&gt;Cheers.&lt;/p&gt;
 </description>
     <pubDate>Wed, 23 Apr 2003 18:29:37 +0000</pubDate>
 <dc:creator>TonyMontana</dc:creator>
 <guid isPermaLink="false">comment 1129858 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-file-access#comment-1129268</link>
    <description> &lt;p&gt;PHP to flash, hmmm - pass &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/wink.png&quot; title=&quot;Wink&quot; alt=&quot;Wink&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;just use some validation on the &#039;contentEngine.php&#039; page, a referrer check and/or extra variable check&lt;br /&gt;
Or just make what your passing unreadable (or backwards) on=off, left=right, north=east ... just be sure to write it down or you&#039;ll confuse yourself &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/big.png&quot; title=&quot;Laughing out loud&quot; alt=&quot;Laughing out loud&quot; class=&quot;smiley-content&quot; /&gt;&lt;br /&gt;
You could also use your .htaccess to allow from only one place/page/section&lt;/p&gt;
 </description>
     <pubDate>Tue, 15 Apr 2003 20:47:01 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1129268 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-file-access#comment-1129221</link>
    <description> &lt;p&gt;Busy, that&#039;s PHP formatted data being sent to Flash MX, which I copied by visiting the PHP page. &lt;/p&gt;
&lt;p&gt;   I only want that page to be accessed by the Flash MX file...in other words, I don&#039;t want someone to freely access &#039;contentEngine.php&#039; and grab all the name/value attribute pairs.&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Tony&lt;/p&gt;
 </description>
     <pubDate>Tue, 15 Apr 2003 05:18:04 +0000</pubDate>
 <dc:creator>TonyMontana</dc:creator>
 <guid isPermaLink="false">comment 1129221 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-file-access#comment-1129210</link>
    <description> &lt;p&gt;what about breaking them down into &#039;if&#039; statements&lt;br /&gt;
just use a page.php?showme=1&lt;br /&gt;
if ($showme == 1) {&lt;br /&gt;
0=1;&lt;br /&gt;
ID=1;&lt;br /&gt;
1=Comp.swf;&lt;br /&gt;
initials=C.swf;&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
but remember variables can&#039;t start with a number&lt;/p&gt;
&lt;p&gt;also how is the info getting there, from a link or form, post and get do different things&lt;/p&gt;
 </description>
     <pubDate>Mon, 14 Apr 2003 23:13:35 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1129210 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
