By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,109 Members | 932 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,109 IT Pros & Developers. It's quick & easy.

call two session in an isset

P: 18
HI...i need help in this php project....this is my coding...

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. session_start();
  3. if(isset($_SESSION ['username']))
  4. {
  5. ?>
  6.  
  7. <html>
  8. <body>
  9. Hi, <?php echo $_SESSION['username']['position']; ?> [<a href="logout.php">Logout</a>]
  10. <br><br>
  11. <?php echo    "DAILY TASK LIST"; ?>
  12. <br><br>
  13. <table width="877" border="1">
  14. <tr>     
  15.     <td height="23" colspan="4" valign="top" border:0px;> &nbsp;&nbsp;&nbsp;NAME &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <?php echo $_SESSION['username']; ?></td> 
  16.   </tr>
  17.     <tr>
  18.       <td height="23" colspan="4" valign="top"> &nbsp;&nbsp;&nbsp;POSITION &nbsp;&nbsp; :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <?php echo $_SESSION['position']; ?>     </td> 
  19.     </tr>
  20. </table>
  21. <br>
  22. <br>
  23. <br>
  24. <table border="2">
  25.     <tr> 
  26.      <td width="40" height="23" valign="top">&nbsp;&nbsp;&nbsp;NO </td> 
  27.      <td width="111" valign="top">&nbsp;&nbsp;&nbsp;DATE</td>
  28.      <td width="545" valign="top">&nbsp;&nbsp;&nbsp;MY TASK TODAY </td> 
  29.      <td width="153" valign="top">&nbsp;&nbsp;&nbsp;NOTE </td> 
  30.   </tr>
  31.  
  32. </table>
  33.  
  34. <br><br>
  35.  
  36. </body>
  37. </html>
  38.  
  39. <?php
  40. }
  41. else{
  42. header("Location: login.php");
  43. }
  44. ?>
i had tried many ways to call the position session. but there is no output displayed on the position row....the username session can be called.....i had tried the same coding as session username to session position...but still unable to display the output...
help me please....
Jan 16 '12 #1
Share this Question
Share on Google+
3 Replies


Dormilich
Expert Mod 5K+
P: 8,639
do var_dump($_SESSION); to check what you have saved in your session.
Jan 16 '12 #2

P: 18
where should i write var_dump()$_SESSION;?
I mean, after which line/code?
Jan 17 '12 #3

Dormilich
Expert Mod 5K+
P: 8,639
anywhere after line #2.
Jan 17 '12 #4

Post your reply

Sign in to post your reply or Sign up for a free account.