Can anybody tell me/show me the code, how I can have a page which allows me to upload a file from a local machine, and then put it in a directory on a webserver.
Secondly you can define your path in php
define('FILE_PATH_ADVERTS' , '/home/user/site/dir);
this saves you holding useless info in the DB and also saves you making that connection to retrieve a path.