php - Why is_dir() function is not checking case sensitive in CPanel server -


i tried code in localserver, works correcly if directory having foldername , won't accept same folder create, if uploaded part in server.

if directory having foldername alto , new folder tried name alto created why it.

if knows solution. enter image description here

<?php $folder_type=$_post['folder_type']; $folder_name=$_post['folder_name']; $images="images"; $path="../../".$folder_type."/".$folder_name; if (!is_dir("../../".$folder_type."/".$folder_name)) {  mkdir("../../".$folder_type."/".$folder_name);  mkdir("../../".$folder_type."/".$folder_name."/".$images);  $content = file_get_contents('../../default_code.php'); $fp = fopen($path . "/$folder_name.php","wb"); fwrite($fp,$content); fclose($fp);  }  else {     echo "0"; } chmod("../../".$folder_type."/".$folder_name, 0777); ?> 

to rule out condition @ all. please use strtolower when creating directory. means use this:

$folder_name=strtolower($_post['folder_name']); 

like in future, folders in lowercase , there no chance of contradiction.

i hope helps


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -