Jump to content

cardio5643

Members
  • Posts

    26
  • Joined

  • Last visited

    Never

Everything posted by cardio5643

  1. what is it with this website. you have a forum, so people can ask questions, yet when questions are asked the responses are rude and and unhelpful.
  2. I am wondering if it is possible to have the client sitting on one html page, and on a javascript function call, run a php file, while staying on the same (0riginal) page?????
  3. from a terminal, the following command $: php test.php returns otice: Undefined index: REQUEST_METHOD in /wfw/redir/test.php on line 5 Fatal error: Call to undefined function curl_init() in /wfw/redir/test.php on line 13
  4. but i am not getting my contents from a file, i am getting them from an asynchronous javascript routine.
  5. I'd send you a screen shot if i could. i created a new file, pasted that code exactly into it, went to my browser, called it, and got a completely blank and white screen..
  6. Obviously it is crashing, but I am not trying to write the word test to a file, i am trying to write the contents of the xml, meaning where the word test is i would have something like $xml->number, but that does not work either. so to prove that the simplexml JUST BEING IN THE FILE crashes the file, i put it in there but kept the text 'test' to write in order to debug. my xml looks validated to me - but maybe someone knows better and i do not mean to be a bother, my first thread was dying, my second didnt make sense, so this is my third. will not do again.
  7. Understood, this is where the casting comes in. Such as fwrite(handle, (string)$simXml), correct? And as for my raw xml, is <root><number>1</number></root> well-formed and syntactically valid ??
  8. This code creates and writes to file <?php $xmlFile = "../etc/someXMLfile.xml"; $xmlHandle = fopen($xmlFile, "w"); fwrite($xmlHandle, 'test'); fclose($xmlHandle); ?> This code does create, but does NOT write to file <?php $xmlFile = "../etc/someXMLfile.xml"; $xmlHandle = fopen($xmlFile, "w"); $flashXML = simplexml_load_string('<root><number>1</number></root>'); fwrite($xmlHandle, 'test'); fclose($xmlHandle); ?> This is the goal code: <?php $flashRAW = file_get_contents("php://input"); $xml = simplexml_load_string($flashRAW); $str = $xml->number->{0}; $xmlFile = "../etc/someXMLfile.xml"; $xmlHandle = fopen($xmlFile, "w"); fwrite($xmlHandle, $str); fclose($xmlHandle); ?> Now, who can tell me what I am doing wrong - because I have tried with no luck. h e l p
  9. I need to send raw, unorganised data to the server, which is running php scripts. I need to catch it with the php, organize it, store it, and send it back down to the client after its altered. I THOUGHT being that XML is simple enough as it is, php would have an XML parser. This is how I came across simplexml, there are others i think, but this is the one for my php version. upgrading is def a consideration, but im not asking the world here, i just wanted to get some xml, go traverse through it, and save it to a file. fml.
  10. No, this is just the simplest form of xml i could think of, the real xml will be the data held in a table containing roughly anywhere from 100 to 200 cells. If the simplexml works on its own, as long as no file write is NOT contained elsewhere in the php file, is there ANY other way for me to see that i AM getting it, and successfully loading it into simplexml_load_string() ? Like if the browser were landing on this php page, instead of just calling its scripts, than i could just echo and debug like that, but since i am asynchronously sending the raw data up, I cannot land on that page...
  11. That is so strange. I can't imagine how that would affect that. -Is this your server or with a hosting service? -Do you have access to the PHP error logs, and is there anything in them? -Is this the ACTUAL code you are using or an abbreviated version? -What if you use different file functions: Code: [select] <?php $xmlFile = "../etc/someXMLfile.xml"; $flashXML = simplexml_load_string('<root><number>1</number></root>'); file_put_contents($xmlFile,'test'); ?> It is my server, it is running off a linux box. I searched for as many logs as I could and found nothing having to do with this. And yes, this is the actual code, exactly what i am using. That new file function was a no go either - didn't even create the file. I guess I am just stuck
  12. It is my server, it is running off a linux box. I searched for as many logs as I could and found nothing having to do with this. And yes, this is the actual code, exactly what i am using. That new file function was a no go either - didn't even create the file. I guess I am just stuck
  13. 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??
  14. where would i view these errors?
  15. 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?
  16. 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?
  17. Yes, they both create the file if it is not there, but only the first bit of code actually writes something to the file...What should I do? Is there another way to do what I am trying to do??
  18. Same thing, creates the file, but file has no contents. you are now doing exactly what i have been doing for the past 2 days. its great fun isnt it?
  19. Okay so now it is touching the somxml file, if it is not there it will create it, but the actual file contains nothing. Its like if simplexml is involved, fwrite wont work...
  20. wow you had me really really excited right there, i thought it was good to go. but now the script is not even touching the simplXMLfile. not even changing the modify date, or creating a new one if the file isnt there. i really don't understand
  21. Okay, now the file reads: :/wfw/etc# more someXMLfile.xml <root><number>1</number></root> That xml is what I have been trying to send to the php server from client side javascript
  22. Thank you so much by the way for doing this. if the file is not there, the script creates the file, but there is not any thing in the file.
  23. Yes, file reads: /wfw/etc# more someXMLfile.xml I found the file
  24. I would try this debugging and others also, but the php page is not what is loaded on the client side. the php is just to collect and save the data, after the reqXML.send(/*"<?xml version='1.0' encoding='UTF-8'?>" + */xmlBody);, the browser returns to the same html page. the reason i say this is because i do not kno how to see the php's output if the browswer is not landing on that page...help!?
  25. Yea just a minor typo while posting here, that is def. not the error in my php file. i work in a linux environment and when i 'php filename.php' the command line i get zero errors.
×
×
  • 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.