Jump to content

This just won't work!!


quique1484

Recommended Posts

Hi, i've been trying to do the following: i have a header for all my website, which is called by an include, so my problem is this: i have different flash animations for the different pages that i have, so i wrote this in <TD> in my header: <? if ($a==1){echo "<embed src=\"/injury/flash/home.swf\" quality=\"high\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"952\" height=\"231\"></embed>";}

  elseif ($a==2){echo "<embed src=\"/injury/flash/auto.swf\" quality=\"high\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"952\" height=\"231\"></embed>";}

    elseif ($a==3){echo "<embed src=\"/injury/flash/truck.swf\" quality=\"high\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"952\" height=\"231\"></embed>";}

    elseif ($a==4){echo "<embed src=\"/injury/flash/moto.swf\" quality=\"high\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"952\" height=\"231\"></embed>";}

    elseif ($a==5){echo "<embed src=\"/injury/flash/dog.swf\" quality=\"high\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"952\" height=\"231\"></embed>";}

    elseif ($a==6){echo "<embed src=\"/injury/flash/cruise.swf\" quality=\"high\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"952\" height=\"231\"></embed>";}

  elseif ($a==7) {echo "<embed src=\"/injury/flash/amusement.swf\" quality=\"high\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"952\" height=\"231\"></embed>";} 

  elseif ($a==8) {echo "<embed src=\"/injury/flash/slip.swf\" quality=\"high\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"952\" height=\"231\"></embed>";} 

  elseif ($a==9){echo "<embed src=\"/injury/flash/focus main.swf\" quality=\"high\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"952\" height=\"231\"></embed>";}

  elseif ($a==10){echo "<embed src=\"/injury/flash/focus auto.swf\" quality=\"high\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"952\" height=\"231\"></embed>";}

  elseif ($a==11){echo "<embed src=\"/injury/flash/focus truck.swf\" quality=\"high\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"952\" height=\"231\"></embed>";}

  elseif ($a==12)  {echo "<embed src=\"/injury/flash/focus moto.swf\" quality=\"high\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"952\" height=\"231\"></embed>";}

  elseif ($a==13) {echo "<embed src=\"/injury/flash/focus slip.swf\" quality=\"high\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"952\" height=\"231\"></embed>";} 

  elseif ($a==14){echo "<embed src=\"/injury/flash/other areas.swf\" quality=\"high\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"952\" height=\"231\"></embed>";}

?>

 

But it just won't work, can you please tell what is wrong with this code?. THANK YOU SO MUCH

Link to comment
https://forums.phpfreaks.com/topic/131561-this-just-wont-work/
Share on other sites

First put all your code in the [ code ][ / code ] tags.

 

Then never use short php tags (<? ?>) always use <?php ?>

 

Then to make life easier on your self you should write your code like:

<?php
if ($a==1){
?>
<embed src="/injury/flash/home.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="952" height="231"></embed>
<?php
}elseif ($a==2){ //continue code }
?>

 

or 

 

<?php
if ($a==1){
echo '<embed src="/injury/flash/home.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="952" height="231"></embed>';
}elseif ($a==2){ //continue code }
?>

 

that way you don't have to escape every quote.

 

As far as it not working...is the $a variable set?

Link to comment
https://forums.phpfreaks.com/topic/131561-this-just-wont-work/#findComment-683325
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.