Copy and paste this into it:
Now, make sure when you save it that you select the Save As option and save it as phpinfo.php
Note the .php file extension. Sometimes you find that Notepad gives you a double barrelled file extension like phpinfo.php.txt and if it does, just rename it to phpinfo.php
Upload the file to your web space then call it into your browser with http: // www. your site name . co.uk/phpinfo.php
You'll get a very long page full of all kinds of intereting things.
Use Find (Ctrl, F) and search for this variable: DOCUMENT_ROOT
Just to the right of where it says DOCUMENT_ROOT there should be something very roughly along these lines:
Try using this as the document path in your script, since that is the folder location of the virtual web on the web server where you site lives. Make sure you copy and save it since any error or type will disallow the script from running at all.
If it works, great.
Delete the phpinfo.php file from your web space.
If it doesn't work, post again.