XML data not showing up on my php page....

Programming
Tutor: None Selected Time limit: 3 Days

how come my php code doesn't show the xml data?

<?php
 $request_url = "http://alexishoustonmusic.tumblr.com/api/read?start=0&num=1&type=text";$xml = simplexml_load_file($request_url);$post = $xml->posts->post->{‘regular-body’};
 echo '<h1>'.$post.'</h1>';?>

Nov 30th, -0001
Hey, it looks like you are loading an empty feed source. What kind of feed are you trying to get? Did you get these codes online? Are you trying to print out the Trumblr feed? I can write some new codes for you.
Jun 13th, 2013

Hey sorry. I just tried it out. It works fine for me. There is a little problem with your symbol. Copy and paste my code and gives it a try:

<?php
 $request_url = "http://alexishoustonmusic.tumblr.com/api/read?start=0&num=1&type=text";$xml = simplexml_load_file($request_url);$post = $xml->posts->post->{'regular-body'};
 echo '<h1>'.$post.'</h1>';
?>

Jun 13th, 2013

Hi Henry,
Yes, i just found that basic code online, put in my xml url (the url you see in the code) which does show up in a browser with just the url only, but when I put it in that php code to have it show up on my domain, i can't get any results back....

All i want to do is create a php page on my domain where I can get that one tumblr account's data (most recent photo/images posts) and then show the images on my page...

What would you charge to set that code up?

Thx

Jun 13th, 2013

Hey, try to copy and paste the code I just sent you to your .php webpage.  It works fine in my own website. I just tried.


Jun 13th, 2013

Hi Henry,

I just tried your code and still get a blank page when I try it out.....

Any ideas, or what you might charge for this to make sure it works for me?

Thanks

Jun 13th, 2013

I also found this tutorial for you to show images. Yours is more like text-only.

https://drupal.org/node/277619

Jun 13th, 2013

What do you mean blank pages.

I changed the symbol. Here is what you used to have 

{‘regular-body’}, This symbol ‘ is illegal in PHP.

Here is what I changed:

{'regular-body'}

It works fine in my webpage :-)

Are you sure the other part of the page or your php syntax is correct?

Jun 13th, 2013

Thank you, yeah, i only put that url in for testing..
I will try to use the tutorial you sent me and see what happens...

I have had a couple other people tell me the code worked for them but I just can't figure out why it doesn't come up for me.. very frustrating.

Jun 13th, 2013

No worries. Can you upload your .php file here so I can help you?

Jun 13th, 2013

I mean i put the exact code you just sent me into my php file, uploaded it to my host, viewed the page in my browser, and get nothing on the page.. completely blank...


Jun 13th, 2013
Jun 13th, 2013

Hey I think there is sth. wrong w/ your server? You can click this page yourself. It shows the title...

Jun 13th, 2013

Ok, I just uploaded the code to another hosting service i have access to and I do get the one title to show up...
So i guess there is some kind of conflict with my hosting service provider, where that just doesn't load...

I didn't think of that until you replied that it is working, so thank you.

I will try the tutorial you gave me to see if I can all the images to load for me using that other hosting service... And then see what is wrong with my hosting service that stops it from working.

Jun 13th, 2013

You are welcomed :-)

Jun 13th, 2013

Your really fast, thank you very much!
I will inquire with my service to see what they can do to fix this issue...

I will pay my pledge here, hopefully you get part of it at least. I don't know how all that works, brand new here..


Jun 13th, 2013

You don't have to pay it here now. I saw it's your first question. It's free. Ask here next time and pay me. lol

Good luck!

Jun 13th, 2013

The website will pay for your bill this time, no worries. haha

Jun 13th, 2013

Cool thank you!
I may need more help with this if that tutorial doesn't end up working for me...:-)
This is the first forum where someone helped me figure this out... thank you again.


Jun 13th, 2013

Did you know? You can earn $20 for every friend you invite to Studypool!
Click here to
Refer a Friend
...
Nov 30th, -0001
...
Nov 30th, -0001
Dec 6th, 2016
check_circle
Mark as Final Answer
check_circle
Unmark as Final Answer
check_circle
Final Answer

Secure Information

Content will be erased after question is completed.

check_circle
Final Answer