Category : directory

I have an new Ubuntu server and I installed Apache and PHP. I have two domains: example1.com and example2.com. How can i prevent example1.com PHP scripts from seeing example2.com folders? and viceversa? I wish example1.com could only read folders inside /var/html/example1.com/ and example2.com could only read folders inside /var/html/example2.com/ . Even at this moment both ..

Read more

This is my code for uploading file if($_FILES[‘wFile’][‘name’]){ move_uploaded_file($_FILES[‘wFile’][‘tmp_name’], "Images/".$_FILES[‘wFile’][‘name’]); $img=" ".$_FILES[‘wFile’][‘name’]; } I want to change the uploaded file directory. I try to change the path into "/Admin/Image/".$_FILES[‘wFile’][‘name’] but it doesn’t work. Sourc..

Read more

$dir = new DirectoryIterator(K_file_location); foreach ($dir as $fileinfo) { if (!$fileinfo->isDot()) { $file_name=$fileinfo->getFilename(); $spl = new SplFileInfo($file_name); if (strcmp($spl->getExtension(), “xlsx”) == 0) if (strpos($file_name, ‘~’) != true) $upload_file_list[] = $fileinfo->getFilename(); } } i tried adding strpos but seems to be not working. thanks for the help! Sourc..

Read more