PHP file upload and passing diectory
<p>Hi am sorry but I have difficulties solving the problem. What i want to do is to upload file and then pass the directory but its nbot working the way I expect. The upload goes to a server to a file called 'uploads' but I cannot pass the directory , cuz its what I need, in later decode function:
Here's the code for uploading file am using:</p>

<pre><code> &lt;?php
 // Where the file is going to be placed 
 $target_path = "uploads/";

/* Add the original filename to our target path.  
Result is "uploads/filename.extension" */
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']); 

if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) 
{
    echo "The file ".  basename( $_FILES['uploadedfile']['name']). 
    " has been uploaded";
 } else{
    echo "There was an error uploading the file, please try again!";
 }

?&gt;
</code></pre>

<p>and then I want to pass directory to here just after $json = $api->decode ( ):it shld be between the brackets I put ($target_path .  basename( $_FILES['uploadedfile']['name'])) but its not working and I dont know how to solve it. The case decode is supposed to get directory of the file which was just uploaded and then decode what is inside:</p>

<pre><code>  case "decode":
    $json = $api-&gt;decode ($target_path .   basename( $_FILES['uploadedfile']  ['name']));
    $start='{"content":"';
    $pos_start = strpos($json, $start);

    $end='"}';
    $pos_end = strpos($json, $end);
</code></pre>

<p>thanx for any advice, please help me out if you know how, thanx</p>
