DiigIT | IT Community
No Profile Image
Welcome Guest
New User? Register | Login
DiigIT » PHP »

basename( $_FILES[\\\'uploaded\\\'][\\\'name\\\'])

By: | 26 Feb 2009 5:01 am

<p>&lt;p&gt;Hi ,&lt;/p&gt; &lt;p&gt;I am new to PHP and I am stuck with a particular problem.&amp;nbsp; I have written a script to allow the user to upload certain files to my website.&amp;nbsp; Part of the validation is to check if the file exists and is that is the case the user is redirected to another page where they are prompted to replace the existing file.&amp;nbsp; The problem is however, I have lost the value in&amp;nbsp; &lt;i&gt;&lt;b&gt;basename( $_FILES[\\\'uploaded\\\'][\\\'name\\\']).&amp;nbsp; &lt;/b&gt;&lt;/i&gt;&lt;/p&gt; &lt;p&gt;In&amp;nbsp;the sendind&amp;nbsp;&lt;b&gt;&amp;nbsp;&lt;/b&gt;page the value is assigned to a session variable and although the value is available to the redirected page it doesn\\\'t work&amp;nbsp;with the &lt;i&gt;&lt;b&gt;move_uploaded_file &lt;/b&gt;&lt;/i&gt;function, which only appears to work with &lt;b&gt;&lt;i&gt;$_FILES[\\\'upload\\\'].&amp;nbsp; &lt;/i&gt;&lt;/b&gt;Is there&amp;nbsp;a way of passing&amp;nbsp;&lt;i&gt;&lt;b&gt;$_FILES[\\\'upload\\\'] &lt;/b&gt;&lt;/i&gt;to another page?&lt;/p&gt; &lt;p&gt;Thanks&lt;/p&gt; &lt;p&gt;Tris&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt;</p>

Comments

No Comments Posted for this Article.

Leave a comment

Enter the text in the image
img
Can't read?
Type the characters you see in the picture below.


Close Move