farban Posted May 19, 2009 Share Posted May 19, 2009 just wondering what is it i need to do to convert this line of code to php 4 $title= $titles->item(0)->nodeValue; Quote Link to comment https://forums.phpfreaks.com/topic/158816-just-need-help-on-converting-some-code-from-php5-to-php4/ Share on other sites More sharing options...
Cosizzle Posted May 19, 2009 Share Posted May 19, 2009 that looks like its using a class. Classes are 'more' introduced in php5. So im thinking the class will have to be re-written. Quote Link to comment https://forums.phpfreaks.com/topic/158816-just-need-help-on-converting-some-code-from-php5-to-php4/#findComment-837640 Share on other sites More sharing options...
papaface Posted May 19, 2009 Share Posted May 19, 2009 The OP is referring to this http://www.phpfreaks.com/forums/index.php/topic,252975.0.html Don't post duplicate threads. Quote Link to comment https://forums.phpfreaks.com/topic/158816-just-need-help-on-converting-some-code-from-php5-to-php4/#findComment-837643 Share on other sites More sharing options...
farban Posted May 19, 2009 Author Share Posted May 19, 2009 sorry i just wasnt sure if this was different enough to warrent a new thread Quote Link to comment https://forums.phpfreaks.com/topic/158816-just-need-help-on-converting-some-code-from-php5-to-php4/#findComment-837645 Share on other sites More sharing options...
Daniel0 Posted May 19, 2009 Share Posted May 19, 2009 Sorry, but why would you downgrade to a discontinued version that had its end of life announcement almost two years ago? Quote Link to comment https://forums.phpfreaks.com/topic/158816-just-need-help-on-converting-some-code-from-php5-to-php4/#findComment-837682 Share on other sites More sharing options...
Brian W Posted May 19, 2009 Share Posted May 19, 2009 I agree with Daniel, PFMaBiSmAd, Ken2k7, and probably the majority on phpfreaks... you should upgrade, not downgrade. If its not your server, change hosts because its not worth it to sit on an old box friend. Any ways, the one line of code you provided isn't much for us to work off of... does it not work? what does it do when you run it? do you get errors? if so, what are they? Quote Link to comment https://forums.phpfreaks.com/topic/158816-just-need-help-on-converting-some-code-from-php5-to-php4/#findComment-837687 Share on other sites More sharing options...
farban Posted May 19, 2009 Author Share Posted May 19, 2009 i cant change hosts or upgrade the server as its for a client and uni project so i cant really tell the client to upgrade im afraid here is the code <?php $doc = domxml_open_mem(); $doc = domxml_open_file("Playlist.xml"); $musiclist = $doc->get_elements_by_tagname( "mp3" ); foreach( $musiclist as $song ) { $artists = $song->get_elements_by_tagname( "artist" ); $artist=htmlentities(utf8_decode($artist->nodeValue)); $titles= $song->get_elements_by_tagname( "title" ); $title= $titles->nodeValue; $urls = $song->get_elements_by_tagname( "url" ); $url = $urls->nodeValue; echo "<b>$artist - $title - $url\n</b><br>"; } ?> just really need some solution to this ...only need to make the title artist and url appear Quote Link to comment https://forums.phpfreaks.com/topic/158816-just-need-help-on-converting-some-code-from-php5-to-php4/#findComment-837700 Share on other sites More sharing options...
Brian W Posted May 19, 2009 Share Posted May 19, 2009 do you get an error message? Quote Link to comment https://forums.phpfreaks.com/topic/158816-just-need-help-on-converting-some-code-from-php5-to-php4/#findComment-837702 Share on other sites More sharing options...
farban Posted May 19, 2009 Author Share Posted May 19, 2009 Well for the echo it dosent print out the varibles so it should echo $artist - $title - $url instead its echoing - - so its not outputting the varibles Quote Link to comment https://forums.phpfreaks.com/topic/158816-just-need-help-on-converting-some-code-from-php5-to-php4/#findComment-837707 Share on other sites More sharing options...
Daniel0 Posted May 19, 2009 Share Posted May 19, 2009 i cant change hosts or upgrade the server as its for a client and uni project so i cant really tell the client to upgrade im afraid In my opinion you can. Any server admin/host that hasn't upgraded a long time is a joke. Tell your client to get a real host, and tell your university's IT department to get a real admin. Quote Link to comment https://forums.phpfreaks.com/topic/158816-just-need-help-on-converting-some-code-from-php5-to-php4/#findComment-837715 Share on other sites More sharing options...
farban Posted May 19, 2009 Author Share Posted May 19, 2009 can i just say i know its off topic butwould it cost money for a client to upgrade php4 to php5 Quote Link to comment https://forums.phpfreaks.com/topic/158816-just-need-help-on-converting-some-code-from-php5-to-php4/#findComment-837716 Share on other sites More sharing options...
PFMaBiSmAd Posted May 19, 2009 Share Posted May 19, 2009 The software is free - http://www.php.net/downloads.php Quote Link to comment https://forums.phpfreaks.com/topic/158816-just-need-help-on-converting-some-code-from-php5-to-php4/#findComment-837732 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.