URL Help

3 posts by 2 authors in: Forums > CMS Builder
Last Post: March 20, 2012   (RSS)

By KCMedia - March 19, 2012

Hi

i have this code that i want to use to display images from vimeo for the thumbnails it works but what i am trying to do is replace the code for the url with some data from cmsb but it wont work any idea why

this is the code

<?php $hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/37374702.php"));?>

this is what i want it to look like

<?php $hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/<?php echo $home_pageRecord['number'] ?>.php"));?>
Thanks



Craig

KC Media Solutions

www.kcmedia.biz

Re: [kcmedia] URL Help

By (Deleted User) - March 20, 2012

Hi kcmedia,

I think this should work:

<?php $hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/" . $home_pageRecord['number'] . ".php"));?>

You had already declared the beginning of the php script so you don't have to do it again when outputting the value of $home_pageRecord['number']. Instead, you break out of the string (beginning "http..." and insert the value using " . $variable . " - in the example I've left spaces around the periods to make it easier to read but you don't have to have them.

Hope this helps,

Tom