I uploaded some data to a file using file_put_contents("export.csv", $nn);
now I want to write piece of html code to be able to download that file, but I don't want to link the full address because if the domain name or the directory name changed the link is not working anymore... How should I do that to address export.csv in html file ?
Ok, then you can use $_SERVER['HTTP_HOST']
get the server host dynamically. So, even if the domain name changes then the link will work fine. But you shouldn't change your folder name. It should be always same even if you change your host.