# Calling the root directory

**URL:** <https://forum.kirupa.com/t/calling-the-root-directory/250963>\
**Category:** programming\
**Created:** [February 4, 2008, 3:46am UTC](https://forum.kirupa.com/t/calling-the-root-directory/250963 "2008-02-04T03:46:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dreamerp](https://avatars.discourse-cdn.com/v4/letter/d/fbc32d/32.png) [@dreamerp](https://forum.kirupa.com/u/dreamerp)\
**Post date:** [February 4, 2008, 3:46am UTC](https://forum.kirupa.com/t/calling-the-root-directory/250963/1 "2008-02-04T03:46:34Z")

</div>

Hello, I am storing files in a root directory on my web host to protect the files. I call them when users that login request the files.

On a user page, people can upload videos and I use PHP and mySQL to store the file names and it uploads the file to the root directory. Then, when I select the results from the mySQL table, I use this code to play the video-

```php
 
$videorealname = stripcslashes($videorealname);
$videorealname = urlencode($videorealname);
$totalfilepath = $filepath.$videorealname;

<object classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' width='320' height='290'>
          <param name='FileName' value='$videoname'>
          <param name='AutoStart' value='True'>
          <param name='ShowControls' value='True'>
          <param name='ShowStatusBar' value='False'>
          <param name='ShowDisplay' value='False'>
          <param name='AutoRewind' value='True'>
          <embed type='application/x-mplayer2'
pluginspage='http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/' src='$totalfilepath' width='320' height='290' autostart='True' filename='$videoname' showcontrols='True' showstatusbar='False' showdisplay='False' autorewind='True'></embed>
        </object>

```

I tested the player without using PHP and upload a movie file in the same directory as the file and then changed the source to the file name and it worked, so I know that the media object itself is working fine. Any ideas?

Also, I have used this root address before when I stored images and then I read the files using PHP and it worked. Not sure if there is a difference if you don’t use

```php
readfile

```

or not…

Anything will help!

THanks
