<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1020733" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1020733</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-help-4#comment-1127307</link>
    <description> &lt;p&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;PHP&lt;br /&gt;&lt;br /&gt;$file &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= \&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;data/&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$pagename&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;.txt\&quot;;&lt;br /&gt;&lt;br /&gt;if (isset(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;pagedit&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$post&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;pagedit&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$fp&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = fopen(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$file&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &#039;w+&#039;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$fp&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fwrite(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$fp&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$post&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fclose(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$fp&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;form action=\&quot;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$PHP_SELF&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; \&quot; method=\&quot;POST\&quot;&amp;gt;&lt;br /&gt;&amp;lt;textarea name=\&quot;pagedit\&quot; cols=\&quot;45\&quot; rows=\&quot;10\&quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; readfile(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$file&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;&lt;br /&gt;&amp;lt;/textarea&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;&amp;lt;input type=\&quot;submit\&quot; name=\&quot;submit\&quot; value=\&quot;Save Changes\&quot;&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;
&lt;strong&gt;$file = &quot;data/$pagename.txt&quot;;&lt;/strong&gt;&lt;br /&gt;
Must use double quotes, or else $pagename will not be expanded.&lt;br /&gt;
Same thing for &lt;strong&gt;$post = $_POST[pagedit];&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;PHP Docs:&lt;br /&gt;
&lt;a href=&quot;http://www.php.net/manual/en/function.readfile.php&quot; class=&quot;bb-url&quot;&gt;readfile()&lt;/a&gt;&lt;/p&gt;
 </description>
     <pubDate>Sat, 15 Mar 2003 07:57:53 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1127307 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-help-4#comment-1127289</link>
    <description> &lt;p&gt;You learn something new every day, dontcha?&lt;br /&gt;
I&#039;m not sure if I understand the concept of this script, but here&#039;s my shot at a rewrite&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;PHP&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;if (isset(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;pagedit&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;])) {&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$post &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;$_POST[pagedit]&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$file &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;data/$pagename.txt&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$fp &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;fopen&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$file&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;w+&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;fwrite&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$fp&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$post&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;fclose&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$fp&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$file &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;data/$pagename.txt&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$fp &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;fopen&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$file&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;r&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$contents &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;fread &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$fp&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$file&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;));&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;form action&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$PHP_SELF&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; \&quot; method=\&quot;POST\&quot;&amp;gt;&lt;br /&gt;&amp;lt;textarea name=\&quot;pagedit\&quot; cols=\&quot;45\&quot; rows=\&quot;10\&quot;&amp;gt;&lt;br /&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$contents&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; &lt;br /&gt;&amp;lt;/textarea&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;&amp;lt;input type=\&quot;submit\&quot; name=\&quot;submit\&quot; value=\&quot;Save Changes\&quot;&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;
First visit puts the form up with the current contents&lt;br /&gt;
Once submitted, it updates the file and reprints the form&lt;br /&gt;
However, you have &lt;strong&gt;$file = &#039;data/$pagename.txt&#039;&lt;/strong&gt; Where does $pagename come from? That&#039;s also not clean code&lt;br /&gt;
You had &lt;strong&gt;fopen ($file, &#039;w+&#039;)&lt;/strong&gt; which is for writing, you needed &lt;strong&gt;fopen ($file, &#039;r&#039;)&lt;/strong&gt;&lt;br /&gt;
Make sense?&lt;br /&gt;
I&#039;m sure I made some stupid mistake in my fix there, but I cleaned it up a lot!&lt;/p&gt;
 </description>
     <pubDate>Sat, 15 Mar 2003 03:06:39 +0000</pubDate>
 <dc:creator>nike_guy_man</dc:creator>
 <guid isPermaLink="false">comment 1127289 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-help-4#comment-1127286</link>
    <description> &lt;p&gt;Cool, never knew that &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;/p&gt;
 </description>
     <pubDate>Sat, 15 Mar 2003 01:35:56 +0000</pubDate>
 <dc:creator>Renegade</dc:creator>
 <guid isPermaLink="false">comment 1127286 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-help-4#comment-1127268</link>
    <description> &lt;p&gt;Yeah &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;/p&gt;
 </description>
     <pubDate>Fri, 14 Mar 2003 19:49:54 +0000</pubDate>
 <dc:creator>zollet</dc:creator>
 <guid isPermaLink="false">comment 1127268 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-help-4#comment-1127263</link>
    <description> &lt;p&gt;hot damn!&lt;/p&gt;
 </description>
     <pubDate>Fri, 14 Mar 2003 18:34:19 +0000</pubDate>
 <dc:creator>Suzanne</dc:creator>
 <guid isPermaLink="false">comment 1127263 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-help-4#comment-1127261</link>
    <description> &lt;p&gt;&lt;strong&gt;&amp;lt;?=&lt;/strong&gt; basically means echo/print. Here are some other examples how it could be used..&lt;/p&gt;
&lt;p&gt;&amp;lt;?= &quot;Hello World!&quot; ?&amp;gt;&lt;br /&gt;
&amp;lt;?= &quot;Your name is: &quot; . $name ?&amp;gt;&lt;br /&gt;
&amp;lt;?= 3 * 5 ?&amp;gt;&lt;br /&gt;
&amp;lt;?= phpinfo() ?&amp;gt;&lt;/p&gt;
&lt;p&gt;etc...&lt;/p&gt;
 </description>
     <pubDate>Fri, 14 Mar 2003 18:24:24 +0000</pubDate>
 <dc:creator>zollet</dc:creator>
 <guid isPermaLink="false">comment 1127261 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-help-4#comment-1127245</link>
    <description> &lt;p&gt;really? didn&#039;t know that, nifty!&lt;/p&gt;
 </description>
     <pubDate>Fri, 14 Mar 2003 16:24:07 +0000</pubDate>
 <dc:creator>Suzanne</dc:creator>
 <guid isPermaLink="false">comment 1127245 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-help-4#comment-1127237</link>
    <description> &lt;p&gt;You don&#039;t need the ; if you&#039;re using &amp;lt;?= $var ?&amp;gt;&lt;/p&gt;
 </description>
     <pubDate>Fri, 14 Mar 2003 14:35:02 +0000</pubDate>
 <dc:creator>zollet</dc:creator>
 <guid isPermaLink="false">comment 1127237 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-help-4#comment-1127232</link>
    <description> &lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;Quote: &lt;em&gt;Originally posted by necrotic &lt;/em&gt;&lt;br /&gt;
&lt;strong&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;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;form action&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot; PHP_SELF \&quot;&amp;gt;&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;should be&lt;/p&gt;
&lt;p&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;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;form action&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot; echo &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$PHP_SELF&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;; \&quot;&amp;gt;&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Or if your lazy...&lt;/p&gt;
&lt;p&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;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;form action&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$PHP_SELF&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;;\&quot;&amp;gt;&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/tongue.png&quot; title=&quot;Sticking out tongue&quot; alt=&quot;Sticking out tongue&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Fri, 14 Mar 2003 10:05:00 +0000</pubDate>
 <dc:creator>Renegade</dc:creator>
 <guid isPermaLink="false">comment 1127232 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-help-4#comment-1127218</link>
    <description> &lt;p&gt;Hmm... that piece of code is no good. There are too many errors and it doesn&#039;t even make sense. What exactly are you trying to do theyapps?&lt;/p&gt;
 </description>
     <pubDate>Fri, 14 Mar 2003 06:49:00 +0000</pubDate>
 <dc:creator>zollet</dc:creator>
 <guid isPermaLink="false">comment 1127218 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
