Jump to content

Change swf content with php?


Actress

Recommended Posts

Hi!I wanted to remodel my static site in order to be lighter and with less files. I have several links that would link to a different html page with a swf object and a small description below it. What I want to do and I'm mostly sure that PHP can do that is:Each of the links has some sort of label that when the swf display page is opened, it catches which label was clicked and displays the chosen swf and description.Now, I'm not really sure on how to do this. I'm figuring the links should have something like <a href="display.php?action=swf1"> but from there on I'm a bit lost.Can you help?

Link to comment
Share on other sites

Basically what I have now is this:In the page with the links, I have this code for the links <a href="ver.php?action=cena1" target="conteudos">and in the page ver.php I have:switch ($_GET['action']) {case 'cena1': echo "esta é a cena 1";case 'cena2': echo "esta é a cena 2";case 'cena3': echo "esta é a cena 3";}but nothing happens... And It doesn't show any errors too... Am I missing something here?

Link to comment
Share on other sites

Yeah, that should work. You should have breaks in the switch statement, and include a default that will get run if nothing else does.

switch ($_GET['action']) {  case 'cena1':	echo "esta é a cena 1";  break;  case 'cena2':	echo "esta é a cena 2";  break;  case 'cena3':	echo "esta é a cena 3";  break;  default:	echo "no se: {$_GET['action']}";  break;}

That way you'll see something no matter what $_GET['action'] is. Just to test, include only that switch statement on the ver.php, nothing else. Make sure you put the <?php ?> tags around it, but just run that and check it.

Link to comment
Share on other sites

Yeah, that should work. You should have breaks in the switch statement, and include a default that will get run if nothing else does.
Well, it works now! I guess it was missing the the brake and/or the default thing, and maybe going nuts about it! Thanks! :)
Link to comment
Share on other sites

Archived

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

×
×
  • Create New...