Hi All,
I am using the PHP Copy call function to copy an existing file in a folder and rename it for the new page that is being created and it works to get the additional file created inside the folder, but then when I try to go to that file by way of direct url it gives a NO SUCH FILE OR DIRECTORY error.
Here is what I did to explain so someone can tell me where I went wrong:
1. I created a PHP file that has the Copy function to generate the desired file and that works fine and generates the file inside the newly created folder to hold it...
PHP Code:
$listing_name = str_replace(" ","_",$listing_title);
$targetFile = "webpage/site_webpage.php";
$targetCopy="webpage/$listing_name.php";
copy($targetFile, $targetCopy);
if (file_exists($targetCopy)) {
$destination = "webpage/$listing_name.php";
} else {
echo "Failure: $targetCopy does not exist";
}
2. There is some code above that to get the $listing_name (title) to name the file, but all this works and that file is named site_detail_create_page.php and when ran generates the desired file and places it in the WEBPAGE folder that is in the main public_html directory with the site_detail_create_page.php file
3. But when I try to open that file through the web using www.mydomainname.com/webpage/$listing_name.php (whatever name assigned for file as is dynamic) it generates the NO SUCH FILE OR DIRECTORY error..
Does anyone know if I missed something like needing to declare that new folder of WEBPAGE somewhere so the server knows it exists, etc..?
Thanks in advance,
JD
Bookmarks