<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">
<channel>
  <title>Linux Format forums</title>
  <link>http://linuxformat.com/forums/index.php</link>
  <description>Help, discussion, magazine feedback and more</description>
  <language>english</language>
  <copyright>(c) Copyright Wed Jun 19, 2013 8:45 am by Linux Format forums</copyright>
  <managingEditor>webmaster@linuxformat.com</managingEditor>
  <webMaster>webmaster@linuxformat.com</webMaster>
  <pubDate>Wed Jun 19, 2013 8:45 am</pubDate>
  <lastBuildDate>Wed Jun 19, 2013 8:45 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://linuxformat.com/forums/</link>
    <description>Help, discussion, magazine feedback and more</description>
  </image>

                                      <item>
                                        <title>Re: PHP coding academy project 1</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=91334#91334</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=21079'&gt;leke&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Wed Jul 28, 2010 4:34 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Is it correct to put 'function' in front of chdir() -- an existing php function?&lt;br /&gt;
&lt;a href=&quot;http://php.net/manual/en/function.chdir.php&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://php.net/manual/en/function.chdir.php&lt;/a&gt;</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=91334#91334</comments>
                                        <author>leke</author>
                                        <pubDate>Wed Jul 28, 2010 4:34 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=91334#91334</guid>
                                      </item>
                                      <item>
                                        <title>Re: PHP coding academy project 1</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=91309#91309</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=14187'&gt;Dutch_Master&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Tue Jul 27, 2010 8:56 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Actually, the solution is part of the error mesage:&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 Parse error&amp;#58;&amp;nbsp; syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting '&amp;amp;' or T_VARIABLE in /home/username/php/project1.php on line 3 &lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;The clue is in the last part: &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;Quote:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;quote&quot;&gt;expecting '&amp;amp;' or T_VARIABLE in /home/username/php/project1.php on line 3 &lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;Now, look at your code, what's on line 3? &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;function chdir&amp;#40;&amp;quot;..&amp;quot;&amp;#41;;&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;The PHP parser says it's invalid syntax. The question you now need to ask yourself is: &amp;quot;why is that invalid?&amp;quot; and go from there &lt;img src=&quot;images/smiles/icon_smile.gif&quot; alt=&quot;Smile&quot; border=&quot;0&quot; /&gt;</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=91309#91309</comments>
                                        <author>Dutch_Master</author>
                                        <pubDate>Tue Jul 27, 2010 8:56 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=91309#91309</guid>
                                      </item>
                                      <item>
                                        <title>PHP coding academy project 1</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=91296#91296</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=66782'&gt;dansit&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Tue Jul 27, 2010 6:45 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Hi i have been going through the project 1 php academy book and have come across and experiencing problems! May be i am making a simple fault.&lt;br /&gt;
&lt;br /&gt;
I have got to page 22 and all work well! Got the right output at the terminal. When i got to page 23 and added the extra code i start to get error's when running the script.&lt;br /&gt;
&lt;br /&gt;
This was the page 23 code i added to the script.&lt;br /&gt;
&lt;br /&gt;
chdir(&amp;quot;..&amp;quot;);&lt;br /&gt;
subdir_scan(&amp;quot;.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
This is the complete code and error's.&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;
&lt;br /&gt;
function chdir&amp;#40;&amp;quot;..&amp;quot;&amp;#41;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;subdir_scan&amp;#40;&amp;quot;.&amp;quot;&amp;#41;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp;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 $files&amp;#41;&amp;#123;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;if &amp;#40;$files==&amp;quot;.&amp;quot;&amp;#41;continue;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;if &amp;#40;$files==&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/$files\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/$files&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/$files&amp;quot;&amp;#41;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;#125;&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;
&lt;br /&gt;
subdir_scan&amp;#40;&amp;quot;.&amp;quot;&amp;#41;&lt;br /&gt;
?&amp;gt;&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
Error message.&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 Parse error&amp;#58;&amp;nbsp; syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting '&amp;amp;' or T_VARIABLE in /home/username/php/project1.php on line 3&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;
Any help in what i have done wrong would be great! I'm sure it's a simple mistake i've made but i have checked over and over again!&lt;br /&gt;
&lt;br /&gt;
I am a simple newbie forgive me for not spotting the problem.  &lt;img src=&quot;images/smiles/icon_confused.gif&quot; alt=&quot;Confused&quot; border=&quot;0&quot; /&gt;</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=91296#91296</comments>
                                        <author>dansit</author>
                                        <pubDate>Tue Jul 27, 2010 6:45 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=91296#91296</guid>
                                      </item></channel></rss>