Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter armstrong1118

    (@armstrong1118)

    Sorry, I just realized how not clear I was there. Im looking to hardcode a flash object into a php file. Heres the code where I would like to put the object:

    <?php
    if (is_page('home')) {
    		echo "<div id='flash'>FLASH OBJECT HERE</div>";
    } else {
            echo "<div id='banner'></div>";
    }
    ?>

    I tried to embed it with dreamweaver but because of the echo it throws everything off, anyone have any ideas?

    The code you gave should work just fine. If Dreamweaver is screwing it up, try using a (free) text editor with syntax highlighting instead. I like Notepad++, but I think more folks around here use PSPad.

    Thread Starter armstrong1118

    (@armstrong1118)

    Its all good, I had to cut some ‘fat’ out of the code dreamweaver was putting in and also change the links to the swf to absolute links, and all good now.

    For long stretches of HTML I think it’s better to just escape out of the PHP. For example:

    <?php
    if (is_page('home')) {
    ?>
    <div id='flash'>FLASH OBJECT HERE</div>";
    <?php
    } else {
            echo "<div id='banner'></div>";
    }
    ?>

    Then you don’t have to escape every double quote that occurs.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Flash in php?’ is closed to new replies.