Jump to content

??NOBODY CAN FIGURE THIS OUT??


cardio5643

Recommended Posts

This code creates the file and writes 'test' to its contents

<?php
   $xmlFile = "../etc/someXMLfile.xml";
   $xmlHandle = fopen($xmlFile, "w");
   fwrite($xmlHandle, 'test');
   fclose($xmlHandle);
?>

This code will create the file but have NO contents. Its seems like as long as simplexml is involved the script is crashing.

<?php
   $xmlFile = "../etc/someXMLfile.xml";
   $xmlHandle = fopen($xmlFile, "w");
   $flashXML = simplexml_load_string('<root><number>1</number></root>');
   fwrite($xmlHandle, 'test');
   fclose($xmlHandle);
?>

 

ANY IDEAS?

Link to comment
https://forums.phpfreaks.com/topic/167991-nobody-can-figure-this-out/
Share on other sites

Try turning error reporting on.

 

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

 

where would i view these errors?

 

Browser, terminal, wherever you're running it from.  Make sure you place those lines directly after your opening <?php tag.

Try turning error reporting on.

 

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

 

where would i view these errors?

 

Browser, terminal, wherever you're running it from.  Make sure you place those lines directly after your opening <?php tag.

 

 

Maybe I am not doing this right. Those lines were added to my file, I went to my browser, clicked the button that calls the script, the html reloaded as it should, back to the same page, and thats it. I dont get an error in the browser, or the command line. Nothing...

 

What is going on??

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.