Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
PHP ERROR
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Benjames" data-source="post: 191011" data-attributes="member: 26312"><p>PHP ERROR - Please Help! This is my friends site. He changed something and asked me to try and fix it. Everything was working fine. Can somebody please take a look?</p><p> </p><p>Thank you!</p><p> </p><p>Ben!</p><p>[PHP]<?php</p><p>echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";</p><p>echo "\n";</p><p>echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n";</p><p>echo "\n";</p><p>echo "<head>\n";</p><p>echo "\n";</p><p>echo "<title>MisterHerpesPositive - Youtube Gaming Sensation</title>\n";</p><p>echo "\n";</p><p>echo "<meta http-equiv=\"content-type\" content=\"application/xhtml+xml; charset=UTF-8\" />\n";</p><p>echo "<meta name=\"author\" content=\"BenJamin Eastwood - benjamineastwood.co.nf\" />\n";</p><p>echo "<meta name=\"description\" content=\"Youtube Gaming Sensation\" />\n";</p><p>echo "<meta name=\"keywords\" content=\"gaming, here, youtube, RPM, \" />\n";</p><p>echo "<meta name=\"robots\" content=\"index, follow, noarchive\" />\n";</p><p>echo "<meta name=\"googlebot\" content=\"noarchive\" />\n";</p><p>echo "\n";</p><p>echo "<link rel=\"stylesheet\" href=\"images/UrbanArtist.css\" type=\"text/css\" />\n";</p><p>echo "\n";</p><p>echo "</head>\n";</p><p>echo "\n";</p><p>echo "<body>\n";</p><p>echo "\n";</p><p>echo "<!-- wrap starts here -->\n";</p><p>echo "<div id=\"wrap\">\n";</p><p>echo "\n";</p><p>echo " <!--header -->\n";</p><p>echo " <div id=\"header\"> \n";</p><p>echo " \n";</p><p>echo " <h1 id=\"logo-text\"><a href=\"index.html\" title=\"\">MisterHerpesPositive</a></h1> \n";</p><p>echo " <p id=\"intro\">\n";</p><p>echo "\n";</p><p>echo " Total Subscribers - \n";</p><p>echo " \n";</p><p>function GetytSubscribers($username) {</p><p>$xdoc = new DomDocument;</p><p>$xdoc->Load('http://gdata.youtube.com/feeds/api/users/'.$username.'');</p><p>$ytStatistics = $xdoc->getElementsByTagName('statistics')->item(0);</p><p>$totalYouTubeSubscribers = $ytStatistics->getAttribute(subscriberCount);</p><p>return number_format($totalYouTubeSubscribers);</p><p>}</p><p> </p><p>echo GetytSubscribers(MisterHerpesPositive);</p><p>echo " \n";</p><p>echo "\n";</p><p>echo "Total Channel Views - \n";</p><p>echo "\n";</p><p>$ytusr = "MisterHerpesPositive";</p><p>$xdoc = new DomDocument;</p><p>$xdoc->Load('http://gdata.youtube.com/feeds/api/users/'.$ytusr.'');</p><p>$ytstat = $xdoc->getElementsByTagName('statistics')->item(0);</p><p>$total_views_yt = $ytstat->getAttribute(totalUploadViews);</p><p>echo number_format($total_views_yt);</p><p>$twurl = "http://twitter.com/users/show/LinuXplained";</p><p>$response = file_get_contents ( $twurl );</p><p>$t_profile = new SimpleXMLElement ( $response );</p><p>$tcount = $t_profile->followers_count;</p><p>echo $tcount.' follow LinuXplained.com';</p><p>echo "<br></br> \n";</p><p>echo " Not to bad, Right? \n";</p><p>echo "<h4>Shoutouts - Dilly Spotswood - Cant Wait to see you Dilly!</h4> \n";</p><p>echo "\n";</p><p>echo " </p> \n";</p><p>echo " <div id=\"nav\">\n";</p><p>echo " <ul>\n";</p><p>echo " <li id=\"current\"><a href=\"index.html\">Home</a></li>\n";</p><p>echo " <li><a href=\"ourvideos.html\">Our Videos</a></li>\n";</p><p>echo " </ul> \n";</p><p>echo " </div> \n";</p><p>echo " \n";</p><p>echo " <!--header ends--> \n";</p><p>echo " </div>\n";</p><p>echo " \n";</p><p>echo " <!-- content-wrap starts -->\n";</p><p>echo " <div id=\"content-wrap\">\n";</p><p>echo " \n";</p><p>echo " <div id=\"main\">\n";</p><p>echo " \n";</p><p>echo " <a name=\"Welcome\"></a>\n";</p><p>echo " <h2><a href=\"index.html\">Welcome</a></h2>\n";</p><p>echo " \n";</p><p>echo " <p class=\"post-info\">Posted by <a href=\"benjamineastwood.co.nf\">Ben</a> | </p> \n";</p><p>echo " \n";</p><p>echo " <p><strong>Hey There</strong>shit faces.\n";</p><p>echo " This is the Official site of Mister Herpes Positive the online youtube gaming sensation!\n";</p><p>echo " On this site you will find loads of usefull crap that you probably couldnt give less of a shit about and to be fucking honest. We can see why!\n";</p><p>echo " All we ask is that you check out the rest of the site, like us on facebook, follow us on twitter and lend your neighbour some <strong>Sugar</strong>\n";</p><p>echo " </p>\n";</p><p>echo " <p>\n";</p><p>echo " You can find more of my free template designs at <a href=\"http://www.styleshout.com/\">my website</a>.\n";</p><p>echo " For premium commercial designs, you can check out\n";</p><p>echo " <a href=\"http://www.dreamtemplate.com\" title=\"Website Templates\">DreamTemplate.com</a>.\n";</p><p>echo " </p>\n";</p><p>echo " \n";</p><p>echo " </p>\n";</p><p>echo " \n";</p><p>echo " </div>\n";</p><p>echo " \n";</p><p>echo " <!-- sidebar starts -->\n";</p><p>echo " <div id=\"sidebar\"> \n";</p><p>echo " \n";</p><p>echo " <h3>About Us</h3> \n";</p><p>echo " \n";</p><p>echo " <p>\n";</p><p>echo " <a href=\"http://getfirefox.com/\"><img src=\"images/thumb.jpg\" width=\"40\" height=\"40\" alt=\"firefox\" class=\"float-left\" /></a>\n";</p><p>echo " Hey There Knob Heads! Ben here! So Heres some information about us! We're both 15 and from Sheffield (South Yorkshire). Youtube is our passion and its what we do. We will try ANY game if you just let us know on the 'Contact' page or on the Youtube comments (Preffered). I specialise in Web Design and its just what I enjoy, Jamie is more active and plays a lot of Sports.\n";</p><p>echo " </p>\n";</p><p>echo " \n";</p><p>echo " <form id=\"quick-search\" action=\"index.html\" method=\"get\" >\n";</p><p>echo " <p>\n";</p><p>echo " <label for=\"qsearch\">Search:</label>\n";</p><p>echo " <input class=\"tbox\" id=\"qsearch\" type=\"text\" name=\"qsearch\" value=\"Search this site...\" title=\"Start typing and hit ENTER\" />\n";</p><p>echo " <input class=\"btn\" alt=\"Search\" type=\"image\" name=\"searchsubmit\" title=\"Search\" src=\"images/search.gif\" />\n";</p><p>echo " </p>\n";</p><p>echo " </form> \n";</p><p>echo " \n";</p><p>echo " <h3>Sidebar Menu</h3>\n";</p><p>echo " <ul class=\"sidemenu\"> \n";</p><p>echo " <li><a href=\"index.php\">Home</a></li>\n";</p><p>echo " <li><a href=\"ourvideos.html\">Our Videos</a></li>\n";</p><p>echo " </ul> \n";</p><p>echo " \n";</p><p>echo " <h3>Links</h3>\n";</p><p>echo " <ul class=\"sidemenu\">\n";</p><p>echo " <li><a href=\"http://www.youtube.com/misterherpespositive\">Our Channel</a></li>\n";</p><p>echo " <li><a href=\"http://www.facebook.com/misterherpespositive\">Facebook</a></li> \n";</p><p>echo " <li><a href=\"http://www.twitter.com/misterherpespositive\">Twitter</a></li>\n";</p><p>echo " <li><a href=\"http://www.cssmania.com/\">Our Livestreams</a></li> \n";</p><p>echo " </ul>\n";</p><p>echo " \n";</p><p>echo " <h3>Sponsors</h3>\n";</p><p>echo " <ul class=\"sidemenu\">\n";</p><p>echo " <li><a href=\"#\" title=\"Sponsor\">Wanna Sponsor Us?<br />\n";</p><p>echo " <span>Get in touch via the contact page to find out our rates & what's in it for you!</span></a> \n";</p><p>echo " \n";</p><p>echo " <!-- sidebar ends --> \n";</p><p>echo " </div>\n";</p><p>echo " \n";</p><p>echo " <!-- content-wrap ends--> \n";</p><p>echo " </div>\n";</p><p>echo "\n";</p><p>echo " <!-- footer starts here --> \n";</p><p>echo " <div id=\"footer\">\n";</p><p>echo " \n";</p><p>echo " <div id=\"footer-left\">\n";</p><p>echo " <p>\n";</p><p>echo " &copy; Copyright <a href=\"http://www.benjamineastwood.co.nf/\" title=\"BenJamin Eastwood\">BenJamin Eastwood</a>&nbsp;\n";</p><p>echo " \n";</p><p>echo " Website Designed & Created By <a href=\"http://www.benjamineastwood.co.nf/\" title=\"BenJamin Eastwood\">BenJamin Eastwood</a>&nbsp;\n";</p><p>echo " </p> \n";</p><p>echo " </div>\n";</p><p>echo " \n";</p><p>echo " <div id=\"footer-right\">\n";</p><p>echo " <p class=\"align-right\">\n";</p><p>echo " <a href=\"http://www.youtube.com/misterherpespositive\">Our Channel</a> <a href=\"http://www.facebook.com/misterherpespositive\">Facebook</a> <a href=\"http://www.twitter.com/misterherpespositive\">Twitter</a> <a href=\"http://www.cssmania.com/\">Our Livestreams</a>\n";</p><p>echo " </p>\n";</p><p>echo " </div>\n";</p><p>echo " \n";</p><p>echo " </div>\n";</p><p>echo " <!-- footer ends here -->\n";</p><p>echo "\n";</p><p>echo "<!-- wrap ends here -->\n";</p><p>echo "</div>\n";</p><p>echo "\n";</p><p>echo "</body>\n";</p><p>echo "</html>\n";</p><p>?>[/PHP]</p><p> </p><p>This was the error..</p><p>[CODE]Warning: DOMDocument::load(http://gdata.youtube.com/feeds/api/users/MisterHerpesPositive) [domdocument.load]: failed to open stream: Network is unreachable in /srv/disk4/1327683/www/misterherpespositive.co.nf/index.php on line 36</p><p> </p><p>Warning: DOMDocument::load() [domdocument.load]: I/O warning : failed to load external entity "http://gdata.youtube.com/feeds/api/users/MisterHerpesPositive" in /srv/disk4/1327683/www/misterherpespositive.co.nf/index.php on line 36</p><p> </p><p>Fatal error: Call to a member function getAttribute() on a non-object in /srv/disk4/1327683/www/misterherpespositive.co.nf/index.php on line 38[/CODE]</p></blockquote><p></p>
[QUOTE="Benjames, post: 191011, member: 26312"] PHP ERROR - Please Help! This is my friends site. He changed something and asked me to try and fix it. Everything was working fine. Can somebody please take a look? Thank you! Ben! [PHP]<?php echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n"; echo "\n"; echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n"; echo "\n"; echo "<head>\n"; echo "\n"; echo "<title>MisterHerpesPositive - Youtube Gaming Sensation</title>\n"; echo "\n"; echo "<meta http-equiv=\"content-type\" content=\"application/xhtml+xml; charset=UTF-8\" />\n"; echo "<meta name=\"author\" content=\"BenJamin Eastwood - benjamineastwood.co.nf\" />\n"; echo "<meta name=\"description\" content=\"Youtube Gaming Sensation\" />\n"; echo "<meta name=\"keywords\" content=\"gaming, here, youtube, RPM, \" />\n"; echo "<meta name=\"robots\" content=\"index, follow, noarchive\" />\n"; echo "<meta name=\"googlebot\" content=\"noarchive\" />\n"; echo "\n"; echo "<link rel=\"stylesheet\" href=\"images/UrbanArtist.css\" type=\"text/css\" />\n"; echo "\n"; echo "</head>\n"; echo "\n"; echo "<body>\n"; echo "\n"; echo "<!-- wrap starts here -->\n"; echo "<div id=\"wrap\">\n"; echo "\n"; echo " <!--header -->\n"; echo " <div id=\"header\"> \n"; echo " \n"; echo " <h1 id=\"logo-text\"><a href=\"index.html\" title=\"\">MisterHerpesPositive</a></h1> \n"; echo " <p id=\"intro\">\n"; echo "\n"; echo " Total Subscribers - \n"; echo " \n"; function GetytSubscribers($username) { $xdoc = new DomDocument; $xdoc->Load('http://gdata.youtube.com/feeds/api/users/'.$username.''); $ytStatistics = $xdoc->getElementsByTagName('statistics')->item(0); $totalYouTubeSubscribers = $ytStatistics->getAttribute(subscriberCount); return number_format($totalYouTubeSubscribers); } echo GetytSubscribers(MisterHerpesPositive); echo " \n"; echo "\n"; echo "Total Channel Views - \n"; echo "\n"; $ytusr = "MisterHerpesPositive"; $xdoc = new DomDocument; $xdoc->Load('http://gdata.youtube.com/feeds/api/users/'.$ytusr.''); $ytstat = $xdoc->getElementsByTagName('statistics')->item(0); $total_views_yt = $ytstat->getAttribute(totalUploadViews); echo number_format($total_views_yt); $twurl = "http://twitter.com/users/show/LinuXplained"; $response = file_get_contents ( $twurl ); $t_profile = new SimpleXMLElement ( $response ); $tcount = $t_profile->followers_count; echo $tcount.' follow LinuXplained.com'; echo "<br></br> \n"; echo " Not to bad, Right? \n"; echo "<h4>Shoutouts - Dilly Spotswood - Cant Wait to see you Dilly!</h4> \n"; echo "\n"; echo " </p> \n"; echo " <div id=\"nav\">\n"; echo " <ul>\n"; echo " <li id=\"current\"><a href=\"index.html\">Home</a></li>\n"; echo " <li><a href=\"ourvideos.html\">Our Videos</a></li>\n"; echo " </ul> \n"; echo " </div> \n"; echo " \n"; echo " <!--header ends--> \n"; echo " </div>\n"; echo " \n"; echo " <!-- content-wrap starts -->\n"; echo " <div id=\"content-wrap\">\n"; echo " \n"; echo " <div id=\"main\">\n"; echo " \n"; echo " <a name=\"Welcome\"></a>\n"; echo " <h2><a href=\"index.html\">Welcome</a></h2>\n"; echo " \n"; echo " <p class=\"post-info\">Posted by <a href=\"benjamineastwood.co.nf\">Ben</a> | </p> \n"; echo " \n"; echo " <p><strong>Hey There</strong>shit faces.\n"; echo " This is the Official site of Mister Herpes Positive the online youtube gaming sensation!\n"; echo " On this site you will find loads of usefull crap that you probably couldnt give less of a shit about and to be fucking honest. We can see why!\n"; echo " All we ask is that you check out the rest of the site, like us on facebook, follow us on twitter and lend your neighbour some <strong>Sugar</strong>\n"; echo " </p>\n"; echo " <p>\n"; echo " You can find more of my free template designs at <a href=\"http://www.styleshout.com/\">my website</a>.\n"; echo " For premium commercial designs, you can check out\n"; echo " <a href=\"http://www.dreamtemplate.com\" title=\"Website Templates\">DreamTemplate.com</a>.\n"; echo " </p>\n"; echo " \n"; echo " </p>\n"; echo " \n"; echo " </div>\n"; echo " \n"; echo " <!-- sidebar starts -->\n"; echo " <div id=\"sidebar\"> \n"; echo " \n"; echo " <h3>About Us</h3> \n"; echo " \n"; echo " <p>\n"; echo " <a href=\"http://getfirefox.com/\"><img src=\"images/thumb.jpg\" width=\"40\" height=\"40\" alt=\"firefox\" class=\"float-left\" /></a>\n"; echo " Hey There Knob Heads! Ben here! So Heres some information about us! We're both 15 and from Sheffield (South Yorkshire). Youtube is our passion and its what we do. We will try ANY game if you just let us know on the 'Contact' page or on the Youtube comments (Preffered). I specialise in Web Design and its just what I enjoy, Jamie is more active and plays a lot of Sports.\n"; echo " </p>\n"; echo " \n"; echo " <form id=\"quick-search\" action=\"index.html\" method=\"get\" >\n"; echo " <p>\n"; echo " <label for=\"qsearch\">Search:</label>\n"; echo " <input class=\"tbox\" id=\"qsearch\" type=\"text\" name=\"qsearch\" value=\"Search this site...\" title=\"Start typing and hit ENTER\" />\n"; echo " <input class=\"btn\" alt=\"Search\" type=\"image\" name=\"searchsubmit\" title=\"Search\" src=\"images/search.gif\" />\n"; echo " </p>\n"; echo " </form> \n"; echo " \n"; echo " <h3>Sidebar Menu</h3>\n"; echo " <ul class=\"sidemenu\"> \n"; echo " <li><a href=\"index.php\">Home</a></li>\n"; echo " <li><a href=\"ourvideos.html\">Our Videos</a></li>\n"; echo " </ul> \n"; echo " \n"; echo " <h3>Links</h3>\n"; echo " <ul class=\"sidemenu\">\n"; echo " <li><a href=\"http://www.youtube.com/misterherpespositive\">Our Channel</a></li>\n"; echo " <li><a href=\"http://www.facebook.com/misterherpespositive\">Facebook</a></li> \n"; echo " <li><a href=\"http://www.twitter.com/misterherpespositive\">Twitter</a></li>\n"; echo " <li><a href=\"http://www.cssmania.com/\">Our Livestreams</a></li> \n"; echo " </ul>\n"; echo " \n"; echo " <h3>Sponsors</h3>\n"; echo " <ul class=\"sidemenu\">\n"; echo " <li><a href=\"#\" title=\"Sponsor\">Wanna Sponsor Us?<br />\n"; echo " <span>Get in touch via the contact page to find out our rates & what's in it for you!</span></a> \n"; echo " \n"; echo " <!-- sidebar ends --> \n"; echo " </div>\n"; echo " \n"; echo " <!-- content-wrap ends--> \n"; echo " </div>\n"; echo "\n"; echo " <!-- footer starts here --> \n"; echo " <div id=\"footer\">\n"; echo " \n"; echo " <div id=\"footer-left\">\n"; echo " <p>\n"; echo " © Copyright <a href=\"http://www.benjamineastwood.co.nf/\" title=\"BenJamin Eastwood\">BenJamin Eastwood</a> \n"; echo " \n"; echo " Website Designed & Created By <a href=\"http://www.benjamineastwood.co.nf/\" title=\"BenJamin Eastwood\">BenJamin Eastwood</a> \n"; echo " </p> \n"; echo " </div>\n"; echo " \n"; echo " <div id=\"footer-right\">\n"; echo " <p class=\"align-right\">\n"; echo " <a href=\"http://www.youtube.com/misterherpespositive\">Our Channel</a> <a href=\"http://www.facebook.com/misterherpespositive\">Facebook</a> <a href=\"http://www.twitter.com/misterherpespositive\">Twitter</a> <a href=\"http://www.cssmania.com/\">Our Livestreams</a>\n"; echo " </p>\n"; echo " </div>\n"; echo " \n"; echo " </div>\n"; echo " <!-- footer ends here -->\n"; echo "\n"; echo "<!-- wrap ends here -->\n"; echo "</div>\n"; echo "\n"; echo "</body>\n"; echo "</html>\n"; ?>[/PHP] This was the error.. [CODE]Warning: DOMDocument::load(http://gdata.youtube.com/feeds/api/users/MisterHerpesPositive) [domdocument.load]: failed to open stream: Network is unreachable in /srv/disk4/1327683/www/misterherpespositive.co.nf/index.php on line 36 Warning: DOMDocument::load() [domdocument.load]: I/O warning : failed to load external entity "http://gdata.youtube.com/feeds/api/users/MisterHerpesPositive" in /srv/disk4/1327683/www/misterherpespositive.co.nf/index.php on line 36 Fatal error: Call to a member function getAttribute() on a non-object in /srv/disk4/1327683/www/misterherpespositive.co.nf/index.php on line 38[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
PHP ERROR
Top