<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">
<channel>
  <title>Linux Format forums</title>
  <link>http://www.linuxformat.com/forums/index.php</link>
  <description>Help, discussion, magazine feedback and more</description>
  <language>english</language>
  <copyright>(c) Copyright Tue May 21, 2013 9:32 am by Linux Format forums</copyright>
  <managingEditor>webmaster@linuxformat.com</managingEditor>
  <webMaster>webmaster@linuxformat.com</webMaster>
  <pubDate>Tue May 21, 2013 9:32 am</pubDate>
  <lastBuildDate>Tue May 21, 2013 9:32 am</lastBuildDate>
  <docs>http://backend.userland.com/rss</docs>
  <generator>phpBB2 RSS Syndication Mod by Lucas</generator>
  <ttl>1</ttl>

  <image>
    <title>Linux Format forums</title>
    <url></url>
    <link>http://www.linuxformat.com/forums/</link>
    <description>Help, discussion, magazine feedback and more</description>
  </image>

                                      <item>
                                        <title>Re: PHP Coding Academy Project 1</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=93133#93133</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=66909'&gt;NoNameWill&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Tue Sep 21, 2010 4:57 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Now I see the error of my way. I did looked at that thread but it wasn't computing in my brain. Took a good nights rest to let it all set in. &lt;br /&gt;
&lt;br /&gt;
Thank you for the help. Now off to figure out the challenge I am having in project 2.  &lt;img src=&quot;images/smiles/icon_biggrin.gif&quot; alt=&quot;Very Happy&quot; border=&quot;0&quot; /&gt;</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=93133#93133</comments>
                                        <author>NoNameWill</author>
                                        <pubDate>Tue Sep 21, 2010 4:57 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=93133#93133</guid>
                                      </item>
                                      <item>
                                        <title>Re: PHP Coding Academy Project 1</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=93103#93103</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=130'&gt;Ram&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Tue Sep 21, 2010 8:55 am&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Your scanning twice - have a look at this &lt;a href=&quot;http://www.linuxformat.com/forums/viewtopic.php?t=12512&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; class=&quot;postlink&quot;&gt; thread!!! &lt;/a&gt;</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=93103#93103</comments>
                                        <author>Ram</author>
                                        <pubDate>Tue Sep 21, 2010 8:55 am</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=93103#93103</guid>
                                      </item>
                                      <item>
                                        <title>Re: PHP Coding Academy Project 1</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=93095#93095</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=66909'&gt;NoNameWill&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Tue Sep 21, 2010 6:22 am&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      &lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;NoNameWill wrote:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;quote&quot;&gt;I have gotten to the end of project one but I am getting this now&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;PHP Warning&amp;#58;&amp;nbsp; file_put_contents&amp;#40;output&amp;#41;&amp;#58; failed to open stream&amp;#58; Permission denied in /home/will/PHP/project1.php on line 36&lt;br /&gt;
&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
With this script&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;&amp;lt;?php &lt;br /&gt;
function subdir_scan&amp;#40;$dir&amp;#41;&amp;#123;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; $files=scandir&amp;#40;$dir&amp;#41;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; foreach&amp;#40;$files as $file&amp;#41;&amp;#123;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if&amp;#40;$file==&amp;quot;.&amp;quot;&amp;#41;continue;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if&amp;#40;$file==&amp;quot;..&amp;quot;&amp;#41;continue;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print &amp;quot;$dir/$file\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if&amp;#40;is_dir&amp;#40;&amp;quot;$dir/$file&amp;quot;&amp;#41;&amp;#41;&amp;#123;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; subdir_scan&amp;#40;&amp;quot;$dir/$file&amp;quot;&amp;#41;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#125;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;#125;&lt;br /&gt;
&amp;#125;&lt;br /&gt;
chdir&amp;#40;&amp;quot;..&amp;quot;&amp;#41;;&lt;br /&gt;
subdir_scan&amp;#40;&amp;quot;.&amp;quot;&amp;#41;;&lt;br /&gt;
chdir&amp;#40;&amp;quot;..&amp;quot;&amp;#41;;&lt;br /&gt;
&lt;br /&gt;
ob_start&amp;#40;&amp;#41;;&lt;br /&gt;
subdir_scan&amp;#40;&amp;quot;.&amp;quot;&amp;#41;;&lt;br /&gt;
&lt;br /&gt;
$new_run=ob_get_clean&amp;#40;&amp;#41;;&lt;br /&gt;
&lt;br /&gt;
if&amp;#40;file_exists&amp;#40;&amp;quot;output&amp;quot;&amp;#41;&amp;#41;&amp;#123;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; $new_array=explode&amp;#40;&amp;quot;\n&amp;quot;,$new_run&amp;#41;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; $old_run=file_get_contents&amp;#40;&amp;quot;output&amp;quot;&amp;#41;;&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; $old_array=explode&amp;#40;&amp;quot;\n&amp;quot;,$old_run&amp;#41;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; $differences=array_diff&amp;#40;$new_array,$old_array&amp;#41;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; foreach &amp;#40;$differences as $file&amp;#41;&amp;#123;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo &amp;quot;New file detected&amp;#58;$file\n&amp;quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;#125;&lt;br /&gt;
&amp;#125;&lt;br /&gt;
&lt;br /&gt;
file_put_contents&amp;#40;&amp;quot;output&amp;quot;,$new_run&amp;#41;;&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=93095#93095</comments>
                                        <author>NoNameWill</author>
                                        <pubDate>Tue Sep 21, 2010 6:22 am</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=93095#93095</guid>
                                      </item>
                                      <item>
                                        <title>Re: PHP Coding Academy Project 1</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=93094#93094</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=66909'&gt;NoNameWill&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Tue Sep 21, 2010 1:03 am&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      I have gotten to the end of project one but I am getting this now&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;PHP Warning&amp;#58;&amp;nbsp; file_put_contents&amp;#40;output&amp;#41;&amp;#58; failed to open stream&amp;#58; Permission denied in /home/will/PHP/project1.php on line 36&lt;br /&gt;
&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
With this script&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;&amp;lt;?php &lt;br /&gt;
function subdir_scan&amp;#40;$dir&amp;#41;&amp;#123;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; $files=scandir&amp;#40;$dir&amp;#41;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; foreach&amp;#40;$files as $file&amp;#41;&amp;#123;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if&amp;#40;$file==&amp;quot;.&amp;quot;&amp;#41;continue;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if&amp;#40;$file==&amp;quot;..&amp;quot;&amp;#41;continue;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print &amp;quot;$dir/$file\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if&amp;#40;is_dir&amp;#40;&amp;quot;$dir/$file&amp;quot;&amp;#41;&amp;#41;&amp;#123;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; subdir_scan&amp;#40;&amp;quot;$dir/$file&amp;quot;&amp;#41;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#125;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;#125;&lt;br /&gt;
&amp;#125;&lt;br /&gt;
chdir&amp;#40;&amp;quot;..&amp;quot;&amp;#41;;&lt;br /&gt;
subdir_scan&amp;#40;&amp;quot;.&amp;quot;&amp;#41;;&lt;br /&gt;
chdir&amp;#40;&amp;quot;..&amp;quot;&amp;#41;;&lt;br /&gt;
&lt;br /&gt;
ob_start&amp;#40;&amp;#41;;&lt;br /&gt;
subdir_scan&amp;#40;&amp;quot;.&amp;quot;&amp;#41;;&lt;br /&gt;
&lt;br /&gt;
$new_run=ob_get_clean&amp;#40;&amp;#41;;&lt;br /&gt;
&lt;br /&gt;
if&amp;#40;file_exists&amp;#40;&amp;quot;output&amp;quot;&amp;#41;&amp;#41;&amp;#123;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; $new_array=explode&amp;#40;&amp;quot;\n&amp;quot;,$new_run&amp;#41;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; $old_run=file_get_contents&amp;#40;&amp;quot;output&amp;quot;&amp;#41;;&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; $old_array=explode&amp;#40;&amp;quot;\n&amp;quot;,$old_run&amp;#41;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; $differences=array_diff&amp;#40;$new_array,$old_array&amp;#41;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; foreach &amp;#40;differences as $file&amp;#41;&amp;#123;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo &amp;quot;New file detected&amp;#58;$file\n&amp;quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;#125;&lt;br /&gt;
&amp;#125;&lt;br /&gt;
&lt;br /&gt;
file_put_contents&amp;#40;&amp;quot;output&amp;quot;,$new_run&amp;#41;;&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=93094#93094</comments>
                                        <author>NoNameWill</author>
                                        <pubDate>Tue Sep 21, 2010 1:03 am</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=93094#93094</guid>
                                      </item>
                                      <item>
                                        <title>PHP Coding Academy Project 1</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=93092#93092</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=66909'&gt;NoNameWill&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Mon Sep 20, 2010 11:57 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Hello,&lt;br /&gt;
&lt;br /&gt;
I am getting this line in terminal when I run this script.&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;PHP Warning&amp;#58;&amp;nbsp; file_get_contents&amp;#40;output&amp;#41;&amp;#58; failed to open stream&amp;#58; No such file or directory in /home/will/PHP/project1.php on line 22&lt;br /&gt;
&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
There is a output file in PHP directory.&lt;br /&gt;
&lt;br /&gt;
Here is what I have from following the instructions. I think I installed all the programs I need. I got them through SPM in Ubuntu 10.4. &lt;br /&gt;
I know I may have misinterpreted what was there. But I need some help. Thank you &lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;&amp;lt;?php &lt;br /&gt;
function subdir_scan&amp;#40;$dir&amp;#41;&amp;#123;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; $files=scandir&amp;#40;$dir&amp;#41;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; foreach&amp;#40;$files as $file&amp;#41;&amp;#123;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if&amp;#40;$file==&amp;quot;.&amp;quot;&amp;#41;continue;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if&amp;#40;$file==&amp;quot;..&amp;quot;&amp;#41;continue;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print &amp;quot;$dir/$file\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if&amp;#40;is_dir&amp;#40;&amp;quot;$dir/$file&amp;quot;&amp;#41;&amp;#41;&amp;#123;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; subdir_scan&amp;#40;&amp;quot;$dir/$file&amp;quot;&amp;#41;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#125;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;#125;&lt;br /&gt;
&amp;#125;&lt;br /&gt;
chdir&amp;#40;&amp;quot;..&amp;quot;&amp;#41;;&lt;br /&gt;
subdir_scan&amp;#40;&amp;quot;.&amp;quot;&amp;#41;;&lt;br /&gt;
chdir&amp;#40;&amp;quot;..&amp;quot;&amp;#41;;&lt;br /&gt;
ob_start&amp;#40;&amp;#41;;&lt;br /&gt;
subdir_scan&amp;#40;&amp;quot;.&amp;quot;&amp;#41;;&lt;br /&gt;
&lt;br /&gt;
$new_run=ob_get_clean&amp;#40;&amp;#41;;&lt;br /&gt;
$old_run=file_get_contents&amp;#40;&amp;quot;output&amp;quot;&amp;#41;;&lt;br /&gt;
&lt;br /&gt;
$new_array=explode&amp;#40;&amp;quot;\n&amp;quot;,$new_run&amp;#41;;&lt;br /&gt;
$old_array=explode&amp;#40;&amp;quot;\n&amp;quot;,$old_run&amp;#41;;&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=93092#93092</comments>
                                        <author>NoNameWill</author>
                                        <pubDate>Mon Sep 20, 2010 11:57 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=93092#93092</guid>
                                      </item></channel></rss>