neven Posted September 2, 2011 Share Posted September 2, 2011 :confused:Hi I have a problem with check box in jquery directory tree... I can't get value from it !!! :S The value of $file show's as "array" in the echo"$files"; not as the real value of the file that is show'n in the directory tree. Can someone help mee with this ? <input type='checkbox' name='del[]' id='del' value='$file'/><a href=\"".$path.$file."\"><img src='slike_izgled/file.png'> $file</a> if(isset($_POST['filedel'])) { $id = $_POST[del]; $count = count($id); for ($i=0; $i<$count; $i++){ $files = $_POST['del']; echo"$files.$count"; } Quote Link to comment https://forums.phpfreaks.com/topic/246290-cant-get-checkbox-value/ Share on other sites More sharing options...
jamesxg1 Posted September 2, 2011 Share Posted September 2, 2011 echo '<pre>' . print_r($file, true) . '</pre>'; echo '<pre>' . print_r($files, true) . '</pre>'; Send the results of that back here and I'll see what I can do. James. Quote Link to comment https://forums.phpfreaks.com/topic/246290-cant-get-checkbox-value/#findComment-1264819 Share on other sites More sharing options...
monkeytooth Posted September 2, 2011 Share Posted September 2, 2011 where is the "$_POST['filedel']" field in the above example.. if a input checkbox, radio, text, or otherwise doesnt have the name/id of "filedel" then it is never set, and will just run past the if statement. Quote Link to comment https://forums.phpfreaks.com/topic/246290-cant-get-checkbox-value/#findComment-1264820 Share on other sites More sharing options...
jamesxg1 Posted September 2, 2011 Share Posted September 2, 2011 where is the "$_POST['filedel']" field in the above example.. if a input checkbox, radio, text, or otherwise doesnt have the name/id of "filedel" then it is never set, and will just run past the if statement. I think $_POST['filedel'] is the submit button, maybe? Could be wrong here tho... James Quote Link to comment https://forums.phpfreaks.com/topic/246290-cant-get-checkbox-value/#findComment-1264822 Share on other sites More sharing options...
neven Posted September 2, 2011 Author Share Posted September 2, 2011 Ok this is what i get back "Array.2 Array ( [0] => Dundo Maroje.txt [1] => popis.txt ) Array.2 Array ( [0] => Dundo Maroje.txt [1] => popis.txt ) " That is what I'm loking to get .... Now this is what I need ....This files up from that are the files from directory tree that i have check'ed in check box now I vant to delet them How to do that? Quote Link to comment https://forums.phpfreaks.com/topic/246290-cant-get-checkbox-value/#findComment-1264823 Share on other sites More sharing options...
neven Posted September 2, 2011 Author Share Posted September 2, 2011 where is the "$_POST['filedel']" field in the above example.. if a input checkbox, radio, text, or otherwise doesnt have the name/id of "filedel" then it is never set, and will just run past the if statement. I think $_POST['filedel'] is the submit button, maybe? Could be wrong here tho... James JES THAT IS THE SUBMIT BUTTON !!! Quote Link to comment https://forums.phpfreaks.com/topic/246290-cant-get-checkbox-value/#findComment-1264825 Share on other sites More sharing options...
jamesxg1 Posted September 2, 2011 Share Posted September 2, 2011 Slightly hard to read because there is no "[ PHP][/ PHP]" or "[ CODE][/ CODE]" tags surrounding the results but; Array ( [0] => Dundo Maroje.txt [1] => popis.txt ) Array ( [0]=> Dundo Maroje.txt [1] => popis.txt ) So if you were to put this in your logic it should put you on the right tracks. echo $file[0] . ' - ' . $file[1] . '<br />'; echo $files[0] . ' - ' . $files[1] . '<br />'; James. Quote Link to comment https://forums.phpfreaks.com/topic/246290-cant-get-checkbox-value/#findComment-1264829 Share on other sites More sharing options...
neven Posted September 2, 2011 Author Share Posted September 2, 2011 Slightly hard to read because there is no "[ PHP][/ PHP]" or "[ CODE][/ CODE]" tags surrounding the results but; Array ( [0] => Dundo Maroje.txt [1] => popis.txt ) Array ( [0]=> Dundo Maroje.txt [1] => popis.txt ) So if you were to put this in your logic it should put you on the right tracks. echo $file[0] . ' - ' . $file[1] . '<br />'; echo $files[0] . ' - ' . $files[1] . '<br />'; James. Thanks man ! Now ther is the one more thing that I'm asking ... Can you tell me how to inplement that result in the script that whil delete that file from the directory ? I remind you that this file is in the jquery directory tree . Can you help mee? Quote Link to comment https://forums.phpfreaks.com/topic/246290-cant-get-checkbox-value/#findComment-1264838 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.