<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1019780" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1019780</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/help-fwrite#comment-1120306</link>
    <description> &lt;p&gt;I don&#039;t see why it was printing all those \n&#039;s.&lt;/p&gt;
&lt;p&gt;mySQL is the ideal solution.  It&#039;s much faster than flat files.&lt;/p&gt;
 </description>
     <pubDate>Sat, 30 Nov 2002 23:22:17 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1120306 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/help-fwrite#comment-1120288</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;I tried both of them and it didn&#039;t work. Well, it did. But it just made one line in the file and it was as long as the Random Int (1-15). So if the rand was 5 it would put 00001 in the file. &lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;I would, but then that would happen. I might just have to use MySQL instead =\ I really wanted to use flat files, and it&#039;s not working &amp;gt;&amp;lt;&lt;/p&gt;
 </description>
     <pubDate>Sat, 30 Nov 2002 19:17:50 +0000</pubDate>
 <dc:creator>necrotic</dc:creator>
 <guid isPermaLink="false">comment 1120288 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/help-fwrite#comment-1120109</link>
    <description> &lt;p&gt;hmm, take out that \n then&lt;/p&gt;
 </description>
     <pubDate>Fri, 29 Nov 2002 06:58:10 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1120109 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/help-fwrite#comment-1119955</link>
    <description> &lt;p&gt;And the resulting outcome: &lt;a href=&quot;http://www.eracreations.com/sourceviewer_101.php?file=/members/necrotic/ratios.dat&quot; class=&quot;bb-url&quot;&gt;http://www.eracreations.com/sourceviewer_101.php?file=/members/necrotic/ratios.dat&lt;/a&gt; ... wow&lt;/p&gt;
&lt;p&gt;EDIT: I see what it&#039;s doing. It&#039;s added a new line for every time the script is run. So if I run it ten times, there will be 10 lines between each number.&lt;/p&gt;
 </description>
     <pubDate>Wed, 27 Nov 2002 20:48:24 +0000</pubDate>
 <dc:creator>necrotic</dc:creator>
 <guid isPermaLink="false">comment 1119955 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/help-fwrite#comment-1119951</link>
    <description> &lt;p&gt;I&#039;m sorry, that should be $dat_file.&lt;/p&gt;
&lt;p&gt;and to fix the formatting problem, change fwrite() to:&lt;br /&gt;
fwrite($fp, &quot;$shown\n&quot;)&lt;/p&gt;
 </description>
     <pubDate>Wed, 27 Nov 2002 20:37:08 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1119951 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/help-fwrite#comment-1119948</link>
    <description> &lt;p&gt;I was looking at your code. Where&#039;d you get $file from? It&#039;s not anywhere in your code or mine. Is it supposed to be $fp?&lt;/p&gt;
 </description>
     <pubDate>Wed, 27 Nov 2002 18:39:31 +0000</pubDate>
 <dc:creator>necrotic</dc:creator>
 <guid isPermaLink="false">comment 1119948 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/help-fwrite#comment-1119947</link>
    <description> &lt;p&gt;I tried both of them and it didn&#039;t work. Well, it did. But it just made one line in the file and it was as long as the Random Int (1-15). So if the rand was 5 it would put 00001 in the file.&lt;/p&gt;
 </description>
     <pubDate>Wed, 27 Nov 2002 18:33:32 +0000</pubDate>
 <dc:creator>necrotic</dc:creator>
 <guid isPermaLink="false">comment 1119947 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/help-fwrite#comment-1119944</link>
    <description> &lt;p&gt;Your ratios file isn&#039;t that large, so you could try sucking it into an array right off the bat.  Then just increment the one number, and write the whole array to the file again.&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;function &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;SetRatio&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;() {&lt;br /&gt;&amp;nbsp; global &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$random&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$filename&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&amp;nbsp; if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;is_writable&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$filename&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$dat_file &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: #0000BB&quot;&gt;$filename&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &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: #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;$filename&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;&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: #007700&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print \&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;Cannot open file (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$filename&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)\&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exit;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$max&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = (count(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$file&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$random&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;) ? count(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$file&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;) : &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$random&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$id&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=1; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$id&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;lt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$max&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$id&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; if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$id&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;lt;=count(&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$shown&lt;/span&gt;&lt;span style=&quot;color: #DD0000&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: #0000BB&quot;&gt;$id&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$shown&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = 0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$id&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; == &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$random&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;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sid&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$id&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;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$shown&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$shown&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;+1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!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;$shown&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;&amp;nbsp;&amp;nbsp; print \&quot;Error writting to (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$filename&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;) on line (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$id&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)&amp;lt;br&amp;gt;\&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exit;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&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;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print \&quot;The file &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$filename&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; is not writable\&quot;;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
 </description>
     <pubDate>Wed, 27 Nov 2002 17:43:59 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1119944 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/help-fwrite#comment-1119941</link>
    <description> &lt;p&gt;Oops, sorry.  I guess I missed this thread.&lt;/p&gt;
&lt;p&gt;I&#039;m wondering if it&#039;s having problems writting to the same file handle it&#039;s reading from.  Try this:&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;function &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;SetRatio&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;() {&lt;br /&gt;&amp;nbsp; global &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$random&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$filename&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&amp;nbsp; if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;is_writable&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$filename&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$fp1 &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;$filename&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$fp2 &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;$filename&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$fp1 &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;|| !&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$fp2&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print \&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;Cannot open file (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$filename&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)\&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exit;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$id&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=1; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$id&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;lt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$random&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$id&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; if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$ratios&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = fscanf(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$fp1&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, \&quot;%s\n\&quot;)) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; list(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$shown&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;) = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$ratios&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; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$shown&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = 0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$id&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; == &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$random&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;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sid&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$id&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;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$shown&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$shown&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;+1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!fwrite(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$fp2&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$shown&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print \&quot;Error writting to (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$filename&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;) on line (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$id&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)&amp;lt;br&amp;gt;\&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exit;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!fwrite(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$fp2&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$shown&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print \&quot;Error writting to (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$filename&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;) on line (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$id&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)&amp;lt;br&amp;gt;\&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exit;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // copy the rest of file 1 to file 2&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$ratios&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = fscanf(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$fp1&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, \&quot;%s\n\&quot;)) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; list(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$shown&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;) = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$ratios&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; if (!fwrite(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$fp2&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$shown&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;&amp;nbsp;&amp;nbsp; print \&quot;Error writting to (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$filename&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;) on line (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$id&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)&amp;lt;br&amp;gt;\&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exit;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$id&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;++;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fclose(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$fp1&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fclose(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$fp2&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print \&quot;The file &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$filename&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; is not writable\&quot;;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
 </description>
     <pubDate>Wed, 27 Nov 2002 17:34:16 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1119941 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/help-fwrite#comment-1119897</link>
    <description> &lt;p&gt;Mark, as I posted above, your changes didn&#039;t work &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/sad.png&quot; title=&quot;Sad&quot; alt=&quot;Sad&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Wed, 27 Nov 2002 13:22:08 +0000</pubDate>
 <dc:creator>necrotic</dc:creator>
 <guid isPermaLink="false">comment 1119897 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
