When I define "ID" attribute in DOM PHP a "Name" is also def

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sneta
Forum Newbie
Posts: 5
Joined: Wed Nov 11, 2009 4:47 am

When I define "ID" attribute in DOM PHP a "Name" is also def

Post by sneta »

defined. When I try to read it I get:

"ID X already defined"

I'm quite sure it's because there's the same value for ID and name (which is defined automatically for some reason)

DOM creation code:


$el=$doc->createElement("div");
$at3=$doc->createAttribute("id");
$at3->value="innr".$Values[0];
$el->appendChild($at3);

Dom reading code:
$doc->loadHTMLFile("myfile.htm")

SECOND QUESTION:

How the !#@$# do I pass data thorough AJAX POST (some encode and decode probably) that works for WHATEVER I pass is passed OK.

"Whatever" means signs like \" \' "+", signs like ">" which CANNOT stay %&lt (because they are used as read HTML in createDocumentFragment() and appendXML() and unicode that CANNOT stay as %uxxxx.
Post Reply