Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery, PHP deleting of directory does not work
    primarykey
    data
    text
    <p>I am trying to delete directories using jquery, it does delete and stays on the 1a.php, which executes the code for the delete. What I exactly want is a delete of directory without page refresh, and display a message the directory has been deleted.</p> <p>Please let me know what I am doing wrong here.</p> <p>Thanks in advance Dave</p> <pre><code>Please find the code below // ----------------------------------1a.php if ($_POST['al_del']) { $dir = $_POST['al_del']; //preg_replace('/(\d+)/', '', $_POST['al_del']); rmdir('$dir_path/'.$dir); echo 'album deleted'; } //-----------------------------------1.php where the directories are listed &lt;script&gt; $('#album_del_form').ajaxForm({ target:'#dir_del', success: function() { $('#dir_del').fadeOut(40000); } }); &lt;/script&gt; &lt;div style=" position:relative; top:20px; left:0px; background-color:#BBBBBB; font-family:'Arial Rounded MT Bold'; font-size:12px;"&gt;Current Albums&lt;/div&gt; &lt;div style=" position:relative; top:20px; left:4px; font-family:'Arial Rounded MT'; font-size:12px;"&gt; &lt;? $album_path1 = "$dir_path/"; $cur_dir = opendir($album_path1); chdir($album_path1); $i_count=0; while (($file = readdir($cur_dir)) !== false) { ?&gt; &lt;? if (($file != ".") &amp;&amp; ($file != "..") &amp;&amp; (is_dir($file))){ $i_count=$i_count+1; ?&gt; &lt;div id="dir_del"&gt; &lt;form name="album_del_form" id="album_del_form" method="post" action="1a.php"&gt; &lt;input type="image" src="images/delete.gif" name="al_dell" id="al_dell" value="&lt;? echo $file; ?&gt;"/&gt;&lt;? echo $file; ?&gt; &lt;input type="hidden" id="al_del" value="&lt;? echo $file; ?&gt;" /&gt;&lt;/form&gt; &lt;/div&gt; &lt;? } } ?&gt; &lt;div id="dir_del"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload