SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Aug 2007
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Loading different flash element with session control

    Hi..guys!I have two flash menus which need to be displayed according the existence of session.Why the script can't execute the else part?Thanks...

    Code:
    <table width="80%" height="319" border="0" align="center" bgcolor="#CCCCFF">
      
     <?
    if (!isset($_SESSION['gmemberid'])){
    ?>	
      <tr> 
        <td colspan="2"> <div align="center"> 
      <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="800" height="300">
              <param name="movie" value="flash%20menu/menu.swf">
              <param name="quality" value="high">
              <param name="LOOP" value="false">
              <embed src="flash%20menu/menu.swf" width="800" height="300" loop="false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object>
          </div></td>
      </tr>
    <? 
    }
    
    else {
    ?>
    <tr> 
        <td colspan="2"> <div align="center"> 
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="800" height="300">
              <param name="movie" value="flash%20menu/menu2.swf">
              <param name="quality" value="high">
              <param name="LOOP" value="false">
              <embed src="flash%20menu/menu2.swf" width="800" height="300" loop="false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object>
          </div></td>
          <td><b>Logged in as: <? echo $_SESSION['gmemberid']; ?></b></td><br><br>
      </tr>
    
    <?	
    }
    ?>

  2. #2
    SitePoint Wizard Hammer65's Avatar
    Join Date
    Nov 2004
    Location
    Lincoln Nebraska
    Posts
    1,161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Any time you are using an if construct in a script that isn't working, always check the values that it is evaluating to determine if that is where the problem is.

    Doing something like

    PHP Code:
    var_dump(!isset($_SESSION['gmemberid'])); 
    before the if construct will tell you what it would evaluate to.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •