farban Posted May 19, 2009 Share Posted May 19, 2009 Hey i have a T_OBJECT_OPERATOR syntax error when opening mp3.php page. I know its because its php 4 and dosent understand the code but i want to fix this problem without upgrading to php 5. any help please? mp3.php page <?php $doc = new DOMDocument(); $doc->load( 'Playlist.xml' ); $musiclist = $doc->getElementsByTagName( "mp3" ); foreach( $musiclist as $song ) { $artists = $song->getElementsByTagName( "artist" ); $artist = $artists->item(0)->nodeValue; $titles= $song->getElementsByTagName( "title" ); $title= $titles->item(0)->nodeValue; $urls = $song->getElementsByTagName( "url" ); $url = $urls->item(0)->nodeValue; echo "<b>$artist - $title - $url\n</b><br>"; } ?> Link to comment https://forums.phpfreaks.com/topic/158796-problem-with-syntax/ Share on other sites More sharing options...
papaface Posted May 19, 2009 Share Posted May 19, 2009 Ignore. Link to comment https://forums.phpfreaks.com/topic/158796-problem-with-syntax/#findComment-837522 Share on other sites More sharing options...
farban Posted May 19, 2009 Author Share Posted May 19, 2009 i dont get you lol Link to comment https://forums.phpfreaks.com/topic/158796-problem-with-syntax/#findComment-837530 Share on other sites More sharing options...
papaface Posted May 19, 2009 Share Posted May 19, 2009 Ignore that message I posted is what I mean. Link to comment https://forums.phpfreaks.com/topic/158796-problem-with-syntax/#findComment-837532 Share on other sites More sharing options...
farban Posted May 19, 2009 Author Share Posted May 19, 2009 can anyone help me please? Link to comment https://forums.phpfreaks.com/topic/158796-problem-with-syntax/#findComment-837538 Share on other sites More sharing options...
Ken2k7 Posted May 19, 2009 Share Posted May 19, 2009 You'll have to re-write the code using PHP 4 - http://us3.php.net/domxml PHP 4 doesn't have the DOMDocument class. That's PHP 5. I suggest upgrading. PHP 4 is history man. Link to comment https://forums.phpfreaks.com/topic/158796-problem-with-syntax/#findComment-837539 Share on other sites More sharing options...
PFMaBiSmAd Posted May 19, 2009 Share Posted May 19, 2009 The end of life and end of support for php4 was one and a half years ago. There is no good reason to still be using php4. Link to comment https://forums.phpfreaks.com/topic/158796-problem-with-syntax/#findComment-837649 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.