<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2" -->
<rss version="0.91">
    <channel>
        <title>PHP Circles</title>
        <description>The 10 most recently added comments in the topic &quot;PHP Circles&quot;</description>
        <link>http://www.freewaytalk.net/</link>
        <lastBuildDate>Tue, 18 Nov 2008 04:14:57 -500</lastBuildDate>
        <generator>FeedCreator 1.7.2</generator>
        <item>
            <title>Re: PHP Circles</title>
            <link>http://www.freewaytalk.net/thread/view/34508#m_34646</link>
            <description>&lt;p&gt;Hi Walter &amp;#8212; I did get your idea, but I found a different solution&amp;#8230;
I had uploaded the form.php file to the Resources folder &amp;#8212; and set
the form action to Resources/form.php &amp;#8212; worked well as long as target
page was html extension.&lt;/p&gt;

&lt;p&gt;By uploading the script file to the same level as the new target.php
page, the form data is inserted AND the target.php is properly
processed. How simple was that!&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ve added your code to my stack of &amp;#8220;keepers&amp;#8221; to try and work into the
Next Big Thing&amp;#8230; as getting scripts to jump in and out of directories
is not my bag, apparently. Thanks for the effort, and for your kind
words about my little project :-)&lt;/p&gt;

&lt;p&gt;On Fri, Jun 6, 2008 at 5:54 PM, waltd wrote:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Ernie, did you get my idea? I think that might help you. It looks like your post processing is actually working, in that the form values are going in there. But when you acquire the contents of a file with &lt;code&gt;fread()&lt;/code&gt; or &lt;code&gt;file_get_contents()&lt;/code&gt;, you are not passing that file through the PHP interpreter, so any script elements that are present in it will not be executed in any way.&lt;/p&gt;
  
  &lt;p&gt;Using include will execute them, but will do so at the moment that they are included, using whatever variables happen to be hanging around at the time.&lt;/p&gt;
  
  &lt;p&gt;The &lt;code&gt;render()&lt;/code&gt; function I posted works around that using an output buffer &amp;#8212; it sets up an environment inside the function that is isolated from the rest of the script, feeds in a current snapshot of the global variables at the moment that the function is invoked, and then includes the file, which gets all of its variables replaced with those values, and returns the result.&lt;/p&gt;
  
  &lt;p&gt;By the way, that&amp;#8217;s a very nice looking site!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Ernie Simpson &amp;#8212; Freeway 5 Pro User &amp;#8212; &lt;a href=&quot;http://www.thebigerns.com/freeway/&quot;&gt;http://www.thebigerns.com/freeway/&lt;/a&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;dynamo mailing list
email@hidden
Update your subscriptions at:
&lt;a href=&quot;http://freewaytalk.net/person/options&quot;&gt;http://freewaytalk.net/person/options&lt;/a&gt;&lt;/p&gt;
</description>
            <author>The Big Erns</author>
            <pubDate>Mon, 09 Jun 2008 19:24:52 -500</pubDate>
        </item>
        <item>
            <title>Re: PHP Circles</title>
            <link>http://www.freewaytalk.net/thread/view/34508#m_34516</link>
            <description>&lt;p&gt;Ernie, did you get my idea? I think that might help you. It looks like your post processing is actually working, in that the form values are going in there. But when you acquire the contents of a file with &lt;code&gt;fread()&lt;/code&gt; or &lt;code&gt;file_get_contents()&lt;/code&gt;, you are not passing that file through the PHP interpreter, so any script elements that are present in it will not be executed in any way.&lt;/p&gt;

&lt;p&gt;Using include will execute them, but will do so at the moment that they are included, using whatever variables happen to be hanging around at the time.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;render()&lt;/code&gt; function I posted works around that using an output buffer &amp;#8212; it sets up an environment inside the function that is isolated from the rest of the script, feeds in a current snapshot of the global variables at the moment that the function is invoked, and then includes the file, which gets all of its variables replaced with those values, and returns the result.&lt;/p&gt;

&lt;p&gt;By the way, that&amp;#8217;s a very nice looking site!&lt;/p&gt;

&lt;p&gt;Walter&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;dynamo mailing list
email@hidden
Update your subscriptions at:
&lt;a href=&quot;http://freewaytalk.net/person/options&quot;&gt;http://freewaytalk.net/person/options&lt;/a&gt;&lt;/p&gt;
</description>
            <author>waltd</author>
            <pubDate>Sat, 07 Jun 2008 00:54:05 -500</pubDate>
        </item>
        <item>
            <title>Re: PHP Circles</title>
            <link>http://www.freewaytalk.net/thread/view/34508#m_34514</link>
            <description>&lt;p&gt;Thanks Mike &amp;#8212;&lt;/p&gt;

&lt;p&gt;What I have is a PHP form script which passes form data to the success
page. I also have PHP scripts to process in the success page (the
includes).&lt;/p&gt;

&lt;p&gt;Screenshot of success page accessed via direct url:
&lt;a href=&quot;http://www.thebigerns.com/myproof/Assets/direct.jpg&quot;&gt;http://www.thebigerns.com/myproof/Assets/direct.jpg&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Screenshot of success page accessed via PHP form script:
&lt;a href=&quot;http://www.thebigerns.com/myproof/Assets/form.jpg&quot;&gt;http://www.thebigerns.com/myproof/Assets/form.jpg&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So I think I&amp;#8217;m having post-processing issues, which gives me some
ideas. Probably the wrong ideas, but that&amp;#8217;s at least a start.&lt;/p&gt;

&lt;p&gt;Ernie Simpson &amp;#8212; Freeway 5 Pro User &amp;#8212; &lt;a href=&quot;http://www.thebigerns.com/freeway/&quot;&gt;http://www.thebigerns.com/freeway/&lt;/a&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;dynamo mailing list
email@hidden
Update your subscriptions at:
&lt;a href=&quot;http://freewaytalk.net/person/options&quot;&gt;http://freewaytalk.net/person/options&lt;/a&gt;&lt;/p&gt;
</description>
            <author>The Big Erns</author>
            <pubDate>Fri, 06 Jun 2008 23:41:44 -500</pubDate>
        </item>
        <item>
            <title>Re: PHP Circles</title>
            <link>http://www.freewaytalk.net/thread/view/34508#m_34512</link>
            <description>&lt;p&gt;If I understand the problem correctly, you are trying to include a file that has code in it, and you need that code in the include to render before you do more things to it with string replacement. Try this, instead of using fread to load your string variable. I believe this will work, it&amp;#8217;s the basis of one of my template engines.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function render_static($strFilePath){
    if(file_exists($strFilePath)){
        ob_start();
        extract($GLOBALS);
        include($strFilePath);
        return ob_get_clean();
    }
    return false;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This function will return a string containing the rendered value of the file you pass to it. Any current global variables (current as of the point in the script where the function is called) will be substituted in that file before the replacement is returned.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;//template.php
&amp;lt;div id=&quot;complaint&quot;&amp;gt;
&amp;lt;p&amp;gt;Pardon me, but your
&amp;lt;?=$thing_1?&amp;gt;
just &amp;lt;?=$verb?&amp;gt;
my &amp;lt;?=$thing_2?&amp;gt;&amp;lt;p&amp;gt;&amp;lt;div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;In another file:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$file = '/path/to/template.php';
$thing_1 = 'dog';
$thing_2 = 'loafers';
$verb = 'peed on';
$rendered = render_static($file);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I hope this helps, I&amp;#8217;m still not sure I&amp;#8217;m solving the correct problem for you.&lt;/p&gt;

&lt;p&gt;Walter&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;dynamo mailing list
email@hidden
Update your subscriptions at:
&lt;a href=&quot;http://freewaytalk.net/person/options&quot;&gt;http://freewaytalk.net/person/options&lt;/a&gt;&lt;/p&gt;
</description>
            <author>waltd</author>
            <pubDate>Fri, 06 Jun 2008 23:13:58 -500</pubDate>
        </item>
        <item>
            <title>Re: PHP Circles</title>
            <link>http://www.freewaytalk.net/thread/view/34508#m_34510</link>
            <description>&lt;p&gt;Looks OK Ernie, anyway&amp;#8230; just did a test on my server and it works as
expected there, so&amp;#8230; are you sure there * are * contents to upload- 
success.html? I know, I am sure there is but as it all works OK for me
I thought I would ask! or is the path correct? some servers will not
throw an error when this happens so maybe&amp;#8230;&amp;#8230;.&lt;/p&gt;

&lt;p&gt;The other thing you might try is replace the upload-success.html with
just some text like &amp;#8216;Hi there&amp;#8217; and see if it loads then, or remove
upload-success.html and see if the script throws the error on
if (file_exists($FileSuccessPage) === false) {
which would then at least tell you the path is right.&lt;/p&gt;

&lt;p&gt;HTH
Mike&lt;/p&gt;

&lt;p&gt;On Jun 6, 2008, at 11:41 PM, The Big Erns wrote:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;I&amp;#8217;m sure no one remembers a while back that I started reworking a
  website using PHP includes to call in common content rather than
  change menus, news and promotions on every page by hand. Well, now
  it has come back to bite me on the butt.&lt;/p&gt;
  
  &lt;p&gt;I have a couple of form pages that use PHP to process the form,
  route email notifications, and pass data to the success/fail pages
  The success or failure pages are not processing their own PHP
  includes along with the data sent by the forms, leaving blanks where
  the includes should be. Here&amp;#8217;s the form code responsible for finding
  the success page and populating it with the form variables:&lt;/p&gt;
  
  &lt;p&gt;&lt;a href=&quot;http://pastie.org/210470&quot;&gt;http://pastie.org/210470&lt;/a&gt;&lt;/p&gt;
  
  &lt;p&gt;The resulting success page processes the forwarded form data, but
  fails to process its own PHP includes (I know the file in the pastie
  is .html, but same happens if it&amp;#8217;s .php).&lt;/p&gt;
  
  &lt;p&gt;I&amp;#8217;m so tired, I just need someone else to look at this and say &amp;#8220;No
  wonder, you forgot to __________ the _______________&amp;#8221;.&lt;/p&gt;
  
  &lt;p&gt;Ernie Simpson &amp;#8212; thebigerns&lt;/p&gt;
  
  &lt;hr /&gt;
  
  &lt;p&gt;dynamo mailing list
  email@hidden
  Update your subscriptions at:
  &lt;a href=&quot;http://freewaytalk.net/person/options&quot;&gt;http://freewaytalk.net/person/options&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;hr /&gt;

&lt;p&gt;dynamo mailing list
email@hidden
Update your subscriptions at:
&lt;a href=&quot;http://freewaytalk.net/person/options&quot;&gt;http://freewaytalk.net/person/options&lt;/a&gt;&lt;/p&gt;
</description>
            <author>Mike B</author>
            <pubDate>Fri, 06 Jun 2008 22:48:14 -500</pubDate>
        </item>
        <item>
            <title>Re: PHP Circles</title>
            <link>http://www.freewaytalk.net/thread/view/34508#m_34509</link>
            <description>&lt;blockquote&gt;
  &lt;p&gt;&amp;#8220;No wonder, you forgot to __________ the _______________&amp;#8221;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Oooh, I love MadLibs! Let&amp;#8217;s see now&amp;#8230;. ;-)&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;dynamo mailing list
email@hidden
Update your subscriptions at:
&lt;a href=&quot;http://freewaytalk.net/person/options&quot;&gt;http://freewaytalk.net/person/options&lt;/a&gt;&lt;/p&gt;
</description>
            <author>chuckamuck</author>
            <pubDate>Fri, 06 Jun 2008 21:52:31 -500</pubDate>
        </item>
        <item>
            <title>PHP Circles</title>
            <link>http://www.freewaytalk.net/thread/view/34508</link>
            <description>&lt;p&gt;I&amp;#8217;m sure no one remembers a while back that I started reworking a website using PHP includes to call in common content rather than change menus, news and promotions on every page by hand. Well, now it has come back to bite me on the butt.&lt;/p&gt;

&lt;p&gt;I have a couple of form pages that use PHP to process the form, route email notifications, and pass data to the success/fail pages… The success or failure pages are not processing their own PHP includes along with the data sent by the forms, leaving blanks where the includes should be. Here&amp;#8217;s the form code responsible for finding the success page and populating it with the form variables:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://pastie.org/210470&quot;&gt;http://pastie.org/210470&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The resulting success page processes the forwarded form data, but fails to process its own PHP includes (I know the file in the pastie is .html, but same happens if it&amp;#8217;s .php).&lt;/p&gt;

&lt;p&gt;I&amp;#8217;m so tired, I just need someone else to look at this and say &amp;#8220;No wonder, you forgot to __________ the _______________&amp;#8221;.&lt;/p&gt;

&lt;p&gt;Ernie Simpson &amp;#8212; thebigerns&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;dynamo mailing list
email@hidden
Update your subscriptions at:
&lt;a href=&quot;http://freewaytalk.net/person/options&quot;&gt;http://freewaytalk.net/person/options&lt;/a&gt;&lt;/p&gt;
</description>
            <author>The Big Erns</author>
            <pubDate>Fri, 06 Jun 2008 21:41:26 -500</pubDate>
        </item>
    </channel>
</rss>
