Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6384839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:49:31+00:00 2026-05-25T02:49:31+00:00

From the stop event of a draggable div, I call a php function through

  • 0

From the stop event of a draggable div, I call a php function through ajax. There are permission errors when that script saves the XML.

Warning: SimpleXMLElement::asXML(communities.xml) simpleelement.asxml failed to open stream: permission denied in c:\path\make_update.php. 

The ajax call is done in a div created dynamically, i.e. the div is created by a script and the call to save the xml is defined like this.

echo "  $('#".$node['ID']."').draggable({ stop: function(event, ui) { update_div('".$node['ID']."') } });\n";

The ajax call is done like this.

    function update_div(divid) {

        width= $('#'+divid).width();
        height=$('#'+divid).height();
        coord =$('#'+divid).position();
        dtop = coord.top;
        dleft = coord.left;
        name = "";

        /* alert ('Finished dragging! '+divid+' '+width+' '+height+' '+dtop+' '+dleft); */

       //define php info and make ajax call to update XML
       $.ajax({
           url: "make_update.php",
           type: "POST",
           data: { nodeid: divid, name: name, top: dtop, left: dleft, width: width, height: height },
           cache: false,
           success: function (response) {

               if (response != '') 
               {
                  alert(response);

               }
           }
       });
    }

<?php

ini_set('display_errors', 1);
error_reporting(E_ALL);

function make_update( $nodeid, $name, $top, $left, $width, $height ) {

$nodes = new SimpleXMLElement('communities.xml', null, true);

$returnArray = $nodes->xpath("//COMMUNITY[@ID='$nodeid']");  
$node = $returnArray[0]; 
$node->TOP = $top;

$nodes->asXML('communities.xml');

return $node->TOP;
}

echo make_update(trim($_REQUEST['nodeid']),trim($_REQUEST['name']),trim($_REQUEST['top']),trim($_REQUEST['left']),trim($_REQUEST['width']),trim($_REQUEST['height']));

?>

The data is being retrieved from the XML file. The problem is the permission to save the file. Elsewhere I am able to save the XML. The difference here is that the script is called from .draggable(). How do I define the permissions to be able to save the XML in that scenario? The permission on the XML and the directory where it is located are read write.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T02:49:31+00:00Added an answer on May 25, 2026 at 2:49 am

    It has to do with the folder/file permissions defined on the server. Open the properties for the folder that the XML file resides in Windows and make sure your server can read/write to that folder.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got an Ajax call from the stop event of my jQuery UI sortable
I've made jQuery & AJAX script that uses a PHP function to bring back
Is there a preference or tweak that will stop Eclipse from putting up a
I want to stop the revert event on a draggable element if that element
Is there a way to stop Google from indexing a site?
How do you stop the designer from auto generating code that sets the value
I can't stop the stupid thing from firing off an event when hovering over
Is there a way to stop other subs from running while in a separate
I am trying to create a form that utilizes PHP and Jquery AJAX form
I was to stop the event propagation from the child to the parent, i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.