List Info

Thread: note 63786 added to function.xml-parser-create




note 63786 added to function.xml-parser-create
user name
2006-03-30 16:55:54
keyword: XML PHP parser error on line 1

after a grand struggle, the answer to my problem was simply:

stripslashes()

when XML content gets transferred via HTML through a POST,
" and ' becomes \" and \'.

xml_parser_create then does not locate the header of the XML
string variable, and you get XML error: something whatever
line 1. 

so grab your POSTed variable, but before you send it to your
parser (if you are using a freely available user-created
function such as xmlize() or something, chances are still
they are within the function using xml_parser_create), make
sure you run this:

stripslashes($_POST["xmlvariable"]);
----
Server IP: 216.194.113.175
Probable Submitter: 216.73.153.113
----
X-Spam-Status: No, hits=3.1 required=5.0
tests=DATE_MISSING,FROM_NO_LOWER 
	autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.xml-parser-crea
te.php
Edit        -- http://master.p
hp.net/note/edit/63786
Del: integrated  -- ht
tp://master.php.net/note/delete/63786/integrated
Del: useless     -- http:
//master.php.net/note/delete/63786/useless
Del: bad code    -- http
://master.php.net/note/delete/63786/bad+code
Del: spam        -- http://m
aster.php.net/note/delete/63786/spam
Del: non-english -- h
ttp://master.php.net/note/delete/63786/non-english
Del: in docs     -- http:
//master.php.net/note/delete/63786/in+docs
Del: other reasons-- http://master
.php.net/note/delete/63786
Reject      -- http://master
.php.net/note/reject/63786
Search      -- http://ma
ster.php.net/manage/user-notes.php

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php

note 63786 deleted from function.xml-parser-create by bjori
user name
2006-03-30 17:37:45
Note Submitter: benbakelaar at gmail dot com
Reason: bad code

----

keyword: XML PHP parser error on line 1

after a grand struggle, the answer to my problem was simply:

stripslashes()

when XML content gets transferred via HTML through a POST,
" and ' becomes \" and \'.

xml_parser_create then does not locate the header of the XML
string variable, and you get XML error: something whatever
line 1. 

so grab your POSTed variable, but before you send it to your
parser (if you are using a freely available user-created
function such as xmlize() or something, chances are still
they are within the function using xml_parser_create), make
sure you run this:

stripslashes($_POST["xmlvariable"]);

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )