Zymic Forums

Webmaster resources

Zymic IRC Server

Chat in real time at irc.zymic.com - Learn More

Welcome

Welcome to the Zymic webmaster forums. Our forums are here to provide people the free ability to discuss a range of websites related topics such as design, development coding and marketing.

In order to post you will need to register for a zymic account or if you already have one simply login by using the form on the left.

left Zymic Webmaster ForumsZymic Free Web HostingZymic Free Web Hosting - General Discussion & Help right
  Reply to this topic Start new topic
left right
miki208
post Mar 10 2012, 10:44 PM
Post #1


Newbie
*

Group: Members
Posts: 2
Joined: 14-January 12
Member No.: 225,607



When I want to update my xml file with this PHP script:
CODE
<?php
$xml = simplexml_load_file('reklama.xml'); //This line will load the XML file.

$sxe = new SimpleXMLElement($xml->asXML()); //In this line it create a SimpleXMLElement object with the source of the XML file.
//The following lines will add a new child and others child inside the previous child created.
$reklama = $sxe->addChild('reklama');
$reklama->addChild('autor', $_POST['pAutor']);
$reklama->addChild('naslov', $_POST['pNaslov']);
$reklama->addChild('tekst', $_POST['pTekst']);
//This next line will overwrite the original XML file with new data added
$reklama->asXML('reklama.xml');
echo 'Oglas uspesno dodat!!!';
?>

I get this warning:
Warning: SimpleXMLElement::asXML(reklama.xml) [simplexmlelement.asxml]: failed to open stream: Permission denied in /www/clanteam.com/m/i/k/mikisoft/htdocs/reklama/reklama.php on line 11
Please help me :/
Go to the top of the page 
 
  + Quote Post
ssfdre38
post Mar 10 2012, 11:44 PM
Post #2


THE SILENT FORUM NINJA
*******

Group: Administrators
Posts: 3,706
Joined: 23-January 10
From: on your screen
Member No.: 127,507



chmod it to 755 or 777
Go to the top of the page 
 
  + Quote Post
 Reply to this topic Start new topic
left right
0 Members:
left right
 


Lo-Fi Version Time is now: 19th May 2013 - 08:35 AM