Hey. I'm trying to put together a form where I can add folders to a subfolder - the values seem to pass just fine, but no folder is being made, and I'm a bit at a loss as to why. Here's the code: function add_picture_folder() { $new_folder = $_POST['folder_name']; $img_folder = "images/"; $med_folder = "images/".$new_folder."/medium/"; $thumbs = "images/".$new_folder."/thumbs/"; $combined = "$img_folder"."$new_folder"."/"; global $access_warning; if(!session_is_registered(user_name)) { echo $access_warning; } else { if (isset($_POST['submit'])) { //if (!is_dir($combined)) { mkdir("$combined",0755,true); //} //$med_folder = "images/medium/"; //echo $med_folder; /*if (!is_dir($med_folder)) { mkdir($med_folder); } $tn_folder = "images/".$new_folder."/thumbs/"; if (!is_dir($tn_folder)) { mkdir($tn_folder); }*/ } else { ?> <fieldset id="add_pic_folder"><legend><a href="javascript:toggleLayer('add_pic_form');" title="Legger til mapper som senere kan brukes til å lagre bilder i">Legger til mapper for bildelagring</a></legend> <form id="add_pic_form" method="post" action="<?php echo "$domain"; ?>/index.php?page=admin#add_pic_folder"> <p><label>Skriv inn mappenavn:</label><input class="formlook" type="text" name="folder_name" value="<?php echo $combined; ?>" /></p> <p><input class="button" type="submit" value="Legg til mappe" /></p> </form> <p class='urls'><a class='menu' href='#toppen'>Tilbake til toppen</a></p></fieldset> </fieldset> <?php }}} PHP: Some of it is commented out, just to make sure none of the error-checking would be causing the problem - even with just a "if submit" and a value, it doesn't work - anyone have any insight why? The $img_folder is predefined, and is present on the server. What I would like to do is for this form to add a subfolder to that folder, for instance images/testfolder/ and then add another two subfolders to that new subfolder, like this: images/testfolder/medium and images/testfolder/thumbs - I've tried reading up on this, and I can't really see why it shouldn't work the way I have it. Anyone?
And, to answer myself... It was me being stupid, and using (isset($_POST['submit'])) instead of (isset($_POST['folder_name'])) - got it working just fine now...
Step one of debugging almost any problem: add this at the top and then take a good long look at the output. echo "<pre>"; var_dump($_REQUEST); echo "</pre>"; Code (markup):