WordPress.org

Forums

[resolved] Flash in php? (6 posts)

  1. armstrong1118
    Member
    Posted 7 years ago #

    Im looking to add code to a page template for one of my static pages, does anyone know how to do it?

  2. Adam Brown
    Member
    Posted 7 years ago #

  3. armstrong1118
    Member
    Posted 7 years ago #

    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?

  4. Adam Brown
    Member
    Posted 7 years ago #

    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.

  5. armstrong1118
    Member
    Posted 7 years ago #

    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.

  6. mildlyhotpeppers
    Member
    Posted 7 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.