What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » PHP: XML DOM script not returning values

PHP: XML DOM script not returning values
Author: Message:
ryxdp
Senior Member
****


Posts: 804
Reputation: 16
29 / Male / Flag
Joined: Jun 2006
O.P. PHP: XML DOM script not returning values
I've been writing a PHP script to parse and style the XML file generated by Status2FTP, which I've expanded upon from the original (top right, the DP is YASS though). But I've just tested it now, and it's not returning anything. It doesn't appear to be seeing the XML file properly. I have a feeling it's because I made a variable for the XML's location and used that for loading the DOMDocument, but I don't know why. The getlastupdate() function, when using the string instead of the variable, can find the file, but when I do the same for the XML loading, it still doesn't show anything.

Thanks :)

This post was edited on 01-27-2009 at 05:57 AM by ryxdp.
01-27-2009 03:48 AM
Profile PM Find Quote Report
WDZ
Former Admin
*****

Avatar

Posts: 7106
Reputation: 107
– / Male / Flag
Joined: Mar 2002
RE: PHP: XML DOM script not returning values
php code:
$rootarray = $objDOM->getElementsByTagName("Details");
foreach ($roottag1 as $rootval) {
It looks like you used $roottag1 where you meant $rootarray, or vice versa.

Also, your functions use variables that don't exist within the local scope. For example:
php code:
function getname() {
    echo "<span id=\"name\">$username</span>";
}
$username would be undefined there. See http://php.net/language.variables.scope.

Oh, and another bug:
php code:
if ($clean_strings = 1) {
You probably want to use the equality operator (==), not the assignment operator (=).
01-27-2009 04:18 AM
Profile PM Web Find Quote Report
ryxdp
Senior Member
****


Posts: 804
Reputation: 16
29 / Male / Flag
Joined: Jun 2006
O.P. RE: PHP: XML DOM script not returning values
Hmm, I may have uploaded an earlier version of the script, which would explain a lot of the errors in it.

MeEtc is currently helping me fix it, so I have to scrap the DOM method and use SimpleXML.
01-27-2009 04:46 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On