Loading different flash elements with session control

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vinceboy
    New Member
    • Sep 2007
    • 22

    Loading different flash elements with session control

    Hi..guys.I am newbie here and have a page which need to load two different flash element with session control.However something went wrong in the code and cause the first if clause is not working.I try to echo out what I want before the if clause but it displayed nothing. Thanks for your generious help..

    [PHP]
    <?php
    echo $_SESSION['gmemberid'];
    if (isset($_SESSIO N['gmemberid'])){

    ?>
    <tr>
    <td colspan="2"> <div align="center">
    <object classid="clsid: D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macrom edia.com/pub/shockwave/cabs/flash/swflash.cab#ver sion=6,0,29,0" width="800" height="300">
    <param name="movie" value="flash%20 menu/menu2.swf">
    <param name="quality" value="high">
    <param name="LOOP" value="false">
    <embed src="flash%20me nu/menu2.swf" width="800" height="300" loop="false" quality="high" pluginspage="ht tp://www.macromedia. com/go/getflashplayer" type="applicati on/x-shockwave-flash"></embed></object>
    </div></td>
    <td><b>Logged in as: <?php echo $_SESSION['gmemberid']; ?></b></td><br><br>
    </tr>
    <?php
    }

    if (!(isset($_SESS ION['gmemberid']))){
    ?>
    <tr>
    <td colspan="2"> <div align="center">
    <object classid="clsid: D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macrom edia.com/pub/shockwave/cabs/flash/swflash.cab#ver sion=6,0,29,0" width="800" height="300">
    <param name="movie" value="flash%20 menu/menu.swf">
    <param name="quality" value="high">
    <param name="LOOP" value="false">
    <embed src="flash%20me nu/menu.swf" width="800" height="300" loop="false" quality="high" pluginspage="ht tp://www.macromedia. com/go/getflashplayer" type="applicati on/x-shockwave-flash"></embed></object>
    </div></td>

    </tr>

    <?php
    }
    ?>
    [/PHP]
  • karlectomy
    New Member
    • Sep 2007
    • 64

    #2
    Firstly,

    There is this new syntax in PHP called the if-else clause...

    It might be a little clearer to use.

    Secondly, If you aren't seeing anything, did you use [PHP]session_start() ;[/PHP] at the top of the page? Also, if you aren't seeing anything, then the variable probably isn't set so it wouldn't execute the first if clause.

    Also: If you're outputting a table row (<tr>) then you need to define the <table> before it.
    Last edited by karlectomy; Sep 23 '07, 09:56 PM. Reason: Found mur stuf

    Comment

    • vinceboy
      New Member
      • Sep 2007
      • 22

      #3
      Problem resolved.Thanks a lot.

      Comment

      • vinceboy
        New Member
        • Sep 2007
        • 22

        #4
        Problem resolved.Thanks a lot.

        Comment

        Working...