
cardio5643
Members-
Posts
26 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
cardio5643's Achievements

Newbie (1/5)
0
Reputation
-
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.
-
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?????
-
WEird Combination of fwrite and simplexml
cardio5643 replied to cardio5643's topic in PHP Coding Help
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 -
******NEW guess i am just stuck*$*$*$**$
cardio5643 replied to cardio5643's topic in PHP Coding Help
but i am not getting my contents from a file, i am getting them from an asynchronous javascript routine. -
WEird Combination of fwrite and simplexml
cardio5643 replied to cardio5643's topic in PHP Coding Help
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.. -
******NEW guess i am just stuck*$*$*$**$
cardio5643 replied to cardio5643's topic in PHP Coding Help
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. -
WEird Combination of fwrite and simplexml
cardio5643 replied to cardio5643's topic in PHP Coding Help
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 ?? -
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
-
WEird Combination of fwrite and simplexml
cardio5643 replied to cardio5643's topic in PHP Coding Help
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. -
WEird Combination of fwrite and simplexml
cardio5643 replied to cardio5643's topic in PHP Coding Help
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... -
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
-
WEird Combination of fwrite and simplexml
cardio5643 replied to cardio5643's topic in PHP Coding Help
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 -
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??
-
where would i view these errors?
-
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?