Search found 22 matches

by McManCSU
Mon Jul 16, 2007 11:45 am
Forum: PHP - Code
Topic: Quick question on checkboxes
Replies: 4
Views: 350

Quick question on checkboxes

Is there a need to use the 'value' attribute for checkboxes? For example, if I have something like this: <input name="checkbox" type="checkbox" checked="checked"> Is there a need for the 'value' attribute, since the POST array will have the 'name' if it was checked on p...
by McManCSU
Wed May 30, 2007 11:27 am
Forum: PHP - Code
Topic: Quick question: Adding children in XML
Replies: 8
Views: 2666

Thanks. Ya, it would be nice to have a function like query($str) where you create a node (or nodes in the path) defined by $str...
by McManCSU
Wed May 30, 2007 9:47 am
Forum: PHP - Code
Topic: Quick question: Adding children in XML
Replies: 8
Views: 2666

Ok, we're getting closer. Now, what if no other nodes around it exist, say we want to add <xyz>-><bbb>-><ccc>-><new_node>? Now, I am not sure that the append child will work since there is only one 'common' node (<xyz>)... <xyz> <abc> <def></def> <NEW_NODE></NEW_NODE> <sss></sss> </abc> <bbb> <ccc> ...
by McManCSU
Wed May 30, 2007 9:27 am
Forum: PHP - Code
Topic: Quick question: Adding children in XML
Replies: 8
Views: 2666

Right place in the tree: <xyz> <abc> <def></def> <NEW_NODE></NEW_NODE> <sss></sss> </abc> </xyz> Or even to just append the node after <sss>. I am assuming that creating a node and appending it will put it after the /abc tag?? Thanks
by McManCSU
Wed May 30, 2007 9:08 am
Forum: PHP - Code
Topic: Quick question: Adding children in XML
Replies: 8
Views: 2666

Right, thats what I was meaning when I said it wasn't right :). How can I insert the right node in the right location? Do I use something like the above or what?
by McManCSU
Tue May 29, 2007 5:28 pm
Forum: PHP - Code
Topic: Quick question: Adding children in XML
Replies: 8
Views: 2666

Quick question: Adding children in XML

I want my code to add children within my xml file if the queried tag does not exist, but I can't figure how to add it into the proper section within the nodes. For example: $newText = 'New Text'; $entries = $this->getQuery($query); // does a query using a DOMXPath object $curTag = $entries->item(0);...
by McManCSU
Tue May 29, 2007 3:42 pm
Forum: Miscellaneous
Topic: XML - How to print all children nodes?
Replies: 8
Views: 3304

Thanks for the help. I found my last answer on http://www.w3schools.com/xpath/xpath_syntax.asp

All I have to do is something like:

Code: Select all

query(//xyz[@id='1'])
by McManCSU
Fri May 25, 2007 12:56 pm
Forum: Miscellaneous
Topic: XML - How to print all children nodes?
Replies: 8
Views: 3304

Is it possible to print any attributes? ie: <xyz id="1">? Also, is it possible to format it dependent on which sub element it is?

Thanks
by McManCSU
Fri May 25, 2007 9:59 am
Forum: Miscellaneous
Topic: XML - How to print all children nodes?
Replies: 8
Views: 3304

There will be children with children, with children, etc. How about both answers?

Thanks
by McManCSU
Thu May 24, 2007 5:23 pm
Forum: Miscellaneous
Topic: XML - How to print all children nodes?
Replies: 8
Views: 3304

XML - How to print all children nodes?

I am trying to print all children nodes of a parent node, but I cannot figure out how... This is what I am doing: <server> <xyz> ... </xyz> <zyx> ... </zyx> <abc> ... </abc> </server> $_doc = new DOMDocument(); $_doc->load(SERVER_PATH); $_serverTag = $_doc->getElementsByTagName("server"); ...
by McManCSU
Wed May 09, 2007 2:10 pm
Forum: PHP - Code
Topic: How is this possible? I am returning false, but it 'unset'
Replies: 40
Views: 5792

Good point, but my experience is more versed in a C/C++ environment, so keeping things simpler than that base is preferred :)
by McManCSU
Wed May 09, 2007 10:56 am
Forum: PHP - Code
Topic: And-equals doesnt retain boolean property, what will?
Replies: 1
Views: 641

And-equals doesnt retain boolean property, what will?

This is sort of in another post, but since it has somewhat become cluttered, I am starting this new one: I noticed that an "&=" or "|=" on a Boolean value will not retain its Boolean type. For example if I do something like this: $a = false; $b = false; $a &= $b; if ($a =...
by McManCSU
Wed May 09, 2007 10:49 am
Forum: PHP - Code
Topic: How is this possible? I am returning false, but it 'unset'
Replies: 40
Views: 5792

... Nothing...
by McManCSU
Tue May 08, 2007 11:48 pm
Forum: PHP - Code
Topic: How is this possible? I am returning false, but it 'unset'
Replies: 40
Views: 5792

I see what you are doing, but why you are doing it is beyond me. why are you wasting your time doing it this way anyways? I mean, defining a variable to be the name of a function, to just call the variable later as the function name is very redundant and unnecessary to me. Not to mention the next c...
by McManCSU
Tue May 08, 2007 5:10 pm
Forum: PHP - Code
Topic: How is this possible? I am returning false, but it 'unset'
Replies: 40
Views: 5792

Ok I think then my problem is related to assignments like this: $a = false; $b = false; // Test 1 if ($a === false) { echo ‘This will print’; } $a &= $b; if ($a === false) { echo ‘this will NOT print’; } From what I have gathered, I think this is due to &= being a bit-wise operation. So if I...