graham23s Posted October 28, 2007 Share Posted October 28, 2007 Hi GUys, 1 thing i seem to still have a problem with is the modulous part of php i have a random video from you tube like : <?php ## video for testing $video = '<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/w_1516P6zE8"></param> <param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/w_1516P6zE8" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"> </embed></object>'; ## show 2 ontop of each other ?> i was wanting to display my videos like: Video 1 Video 2 Video 3 Video 4 can anyone tell me the best way or point me to a tutorial , anything would be great. thanks guys Graham Link to comment https://forums.phpfreaks.com/topic/75077-displaying-videos-problem/ Share on other sites More sharing options...
GingerRobot Posted October 28, 2007 Share Posted October 28, 2007 Try this FAQ here: http://www.phpfreaks.com/forums/index.php/topic,95426.0.html It's for database results, but it should't be too hard to modify it for your purpose. Link to comment https://forums.phpfreaks.com/topic/75077-displaying-videos-problem/#findComment-379711 Share on other sites More sharing options...
graham23s Posted October 28, 2007 Author Share Posted October 28, 2007 Hi Mate, thanks for the link, i tried this: <?php ## video for testing $video = '<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/w_1516P6zE8"></param> <param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/w_1516P6zE8" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"> </embed></object>'; ## show 2 ontop of each other $i = 0; echo '<table align="center">'; if ($i==0) { echo '<tr><td>'.$video.'</td>'; } else { echo '<td>'.$video.'</td></tr>'; } $i++; $i=$i % 2; echo '</table>'; ?> to basically show the same video 4 times, but it only shows it once am i missing somehting in my code at all? thanks guys Graham Link to comment https://forums.phpfreaks.com/topic/75077-displaying-videos-problem/#findComment-379719 Share on other sites More sharing options...
LemonInflux Posted October 28, 2007 Share Posted October 28, 2007 You haven't got a loop. Link to comment https://forums.phpfreaks.com/topic/75077-displaying-videos-problem/#findComment-379721 Share on other sites More sharing options...
GingerRobot Posted October 28, 2007 Share Posted October 28, 2007 Yes, you don't have a loop. Try: <?php ## video for testing $video = '<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/w_1516P6zE8"></param> <param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/w_1516P6zE8" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"> </embed></object>'; ## show 2 ontop of each other $i = 0; echo '<table align="center">'; for($x=0;$x<4;$x++){ if ($i==0) { echo '<tr><td>'.$video.'</td>'; } else { echo '<td>'.$video.'</td></tr>'; } $i++; $i=$i % 2; } echo '</table>'; ?> Link to comment https://forums.phpfreaks.com/topic/75077-displaying-videos-problem/#findComment-379722 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.