Jump to content

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??

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.