Author | Message | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ![]() Im trying to make a Admin Panel for a site that im making and im doing the sub-domain/account creation and im trying to copy the default index.php into the folder. $newdirect = "/Users/$domain"; mkdir($newdirect); copy("/Default/index.php", "$newdirect"); copy("/Default/Logo2.png", "$newdirect"); NONE of thoose work. No errors, they just dont work. Not even the mkdir(). Anyone got some suggestions? --- Andrewbob - I would be on the fucking copter of rofls Programmer, Web Developer, and Graphics Designer
|
| ![]() Doubt it'll fix it, but still a pretty dumb thing to do. Why do you have "$variable". The variable is already a string so you can just do $variable with no quotes. Once again, probably won't fix your error. --- http://www.addipop.com
|
| ![]() I no, its just a habit. --- Andrewbob - I would be on the fucking copter of rofls Programmer, Web Developer, and Graphics Designer
|
| ![]() Make sure the permissions are okay. If the file doesn't have permission to make a new directory, it can't. --- http://www.addipop.com
|
| ![]() Yeah, i tried that before i posted. Still didnt work. --- Andrewbob - I would be on the fucking copter of rofls Programmer, Web Developer, and Graphics Designer
|
| ![]() Well a simple way to check what is failing(pretty sure it's mkdir but it doesn't hurt to check) is to check the return value. copy & mkdir return true on success and false on failure. --- http://www.addipop.com
|
| ![]() Yeah, read something earlier. Im pretty sure it returns 1 for true and 0 for false? --- Andrewbob - I would be on the fucking copter of rofls Programmer, Web Developer, and Graphics Designer
|
| ![]() Yeah, check what mkdir returns and see if it's the problem or not. --- http://www.addipop.com
|
| ![]() Its not returning anything? --- Andrewbob - I would be on the fucking copter of rofls Programmer, Web Developer, and Graphics Designer
|
| ![]() if (mkdir($newdirect) == true) { echo 'success'; } else echo 'failure'; Simple as that. --- http://www.addipop.com
|
| ![]() Oh, duh. Inewtat lol. Yup, thats the error. Thx! Now i gotta fix it. Fixed, im stupid. Wasnt using ftp directory -.- I feel very retarded lol. /home/www/wildsurvival/admin/Users --- Andrewbob - I would be on the fucking copter of rofls Programmer, Web Developer, and Graphics Designer
|
| ![]() Alright, just did a little test, I think I have your problem. $newdirect = "/Users/$domain"; That is wrong. $newdirect = "./Users/$domain"; That is right. ./ is taking your current directory and then going into users and then $domain(whatever the variable value is) / I have no clue what it does, but it's not right :P --- http://www.addipop.com
|
| ![]() i tried ./Users and it wasnt working. But the ftp directory worked. Edit: Ok now when i try to move the defaults and stuff into it. It turns into an application/octet-stream . Edit: Fixed --- Andrewbob - I would be on the fucking copter of rofls Programmer, Web Developer, and Graphics Designer |