Jump to content

Echo and isset problems


Patrick3002

Recommended Posts

Ok, my problem is that my if isset statements will only echo the part after else in the if statement... heres the code.

 

I have this at the very top of my page and it echos fine. (It echos: Hi when $email isnt set and $email when $email isset)


<?php session_start(); ?>

<?php 
if ( !isset($email) ) {
echo "Hi";
} else {
echo $email;
}

?>

 

 

Then here is where i have my problem...

This code echos $logged2 if $email isset and nothing if $email isnt set, idk why it wont echo Hi if $email isnt set.

 


<td width="170" align="right" valign="middle" class="tblrow2">
	  <?php
	  if ( !isset($email) ) {
                  echo "Hi";
                  } else {
                  echo $logged2;
                  }

	   ?>
	  </td>

 

Any help would be greatly appreciated!

Link to comment
https://forums.phpfreaks.com/topic/39753-echo-and-isset-problems/
Share on other sites

Heres the second part:

 


<table width="728" border="0" cellspacing="0" cellpadding="2">
    <tr>
      <td height="23" bgcolor="#33CCFF" class="tblrow1">Browse artists: <a href="find.php?pc=A">A</a> 
          <a href="find.php?pc=B">B</a> <a href="find.php?pc=C">C</a> <a href="find.php?pc=D">D</a> 
          <a href="find.php?pc=E">E</a> <a href="find.php?pc=F">F</a> <a href="find.php?pc=G">G</a> 
          <a href="find.php?pc=H">H</a> <a href="find.php?pc=I">I</a> <a href="find.php?pc=J">J</a> 
          <a href="find.php?pc=K">K</a> <a href="find.php?pc=L">L</a> <a href="find.php?pc=M">M</a> 
          <a href="find.php?pc=N">N</a> <a href="find.php?pc=O">O</a> <a href="find.php?pc=P">P</a> 
          <a href="find.php?pc=Q">Q</a> <a href="find.php?pc=R">R</a> <a href="find.php?pc=S">S</a> 
          <a href="find.php?pc=T">T</a> <a href="find.php?pc=U">U</a> <a href="find.php?pc=V">V</a> 
          <a href="find.php?pc=W">W</a> <a href="find.php?pc=X">X</a> <a href="find.php?pc=Y">Y</a> 
          <a href="find.php?pc=Z">Z</a> <a href="find.php?pc=0">#</a> </td>
	  <td width="170" align="right" valign="middle" class="tblrow2">
	  <?php
	  
	  if (!isset($email)) {
           echo "Hi";
           } else {
           echo $logged2;
           }
	   ?>
	  </td>
	  
    </tr>
  </table>

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.