Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Help With Simple XML

Featured Replies

Hey Everyone, I am using simple xml to load my tumblr posts on my web site. My site is at http://www.boyleswebdesign.com/Clients/NewJake/index.php5 . If you notice there are PHP errors on some of the posts. Why is this? Does anyone know how I can get it from getting these errors? Thanks everyone!

what errors? If you could elaborate more then people may be able to assist.

 

I see 3 posts listed and none have PHP errors. The only problem I could see were a couple of images not showing in the somewhat annoying slider at the top of the page.

  • Author

The error I am seeing says...

 

Warning: simplexml_load_file(http://jakeboyles.tumblr.com/api/read?type=post&start=0&num=3) [function.simplexml-load-file]: failed to open stream: HTTP request failed! HTTP/1.1 503 Service Temporarily Unavailable in /homepages/12/d178860016/htdocs/bwd/Clients/NewJake/index.php5 on line 107

 

and yeah I know about the slider. Im still working on it.

503 Service Temporarily Unavailable usually refers to an issue on the web server, typically when it's too busy (overloaded) though not always. Are you running on an overcrowded server? Maybe contacting your host might pinpoint the problme.

  • Author

I have it set up on a local server also and its getting 503's too. My code is...

 

<li><h3>Tumblr Posts</h3></li>
<li> 
<?php
$request_url = "http://jakeboyles.tumblr.com/api/read?type=post&start=0&num=3" ;
$xml = simplexml_load_file($request_url);
$title = $xml->posts->post->{"regular-title"};
$post = $xml->posts->post->{"regular-body"};
$link = $xml->posts->post["url"];
$small_post = substr($post,0,67);
echo "<h2 class='poststitle'><a href=".$link. ">" .$title. "</a></h2>" ;
echo "".$small_post."...";
?>
</li>

 <li>
 <?php
$request_url = "http://jakeboyles.tumblr.com/api/read?type=post&start=1&num=3" ;
$xml = simplexml_load_file($request_url);
$title = $xml->posts->post->{"regular-title"};
$post = $xml->posts->post->{"regular-body"};
$link = $xml->posts->post["url"];
$small_post = substr($post,0,67); 
echo "<h2 class='poststitle'><a href=".$link. ">" .$title. "</a></h2>" ;
	echo "".$small_post."...";
?>
</li>

 <li>
 <?php
$request_url = "http://jakeboyles.tumblr.com/api/read?type=post&start=2&num=3" ;
$xml = simplexml_load_file($request_url);
$title = $xml->posts->post->{"regular-title"};
$post = $xml->posts->post->{"regular-body"};
$link = $xml->posts->post["url"];
$small_post = substr($post,0,67); 
echo "<h2 class='poststitle'><a href=".$link. ">" .$title. "</a></h2>" ;
	echo "".$small_post."...";
?>
</li>
</ol>

 

I am calling for the url 3 times right in a row. Would that overload it? Im not really sure how to get 3 posts from one script, if that makes sense.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.