Jump to content

Recommended Posts

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

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

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>';
?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.