problem in header include

Thread Solved

Join Date: Nov 2007
Posts: 107
Reputation: kings has a little shameless behaviour in the past 
Solved Threads: 2
kings's Avatar
kings kings is offline Offline
Junior Poster

problem in header include

 
0
  #1
Apr 2nd, 2008
  1. <?php
  2. session_start();
  3. if(!isset($_SESSION['un']))
  4. {
  5. header('Location: web_login.html');
  6. exit();
  7. }
  8. else
  9. {
  10. ?>
  11. <html>
  12. <body>
  13. <?php
  14. print "<table align='center'><tr><td>Thank u</td></tr>";
  15.  
  16. echo $_SESSION['un'];
  17.  
  18. print "<tr><td><a href='http://www.examples.com/fram.php'>View Order</a></td></tr>";
  19.  
  20. print "<tr><ta><a href='http://www.examples.com/web_job.php'>Search </a></td></tr>";
  21.  
  22. print "</table>";
  23. }
  24. ?>
  25. </body>
  26. </html>



when i execute this code even though my $_SESSION['un'] is present in the database it's showing the web_login page.else is not working.any error in header include code.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 78
Reputation: jino is an unknown quantity at this point 
Solved Threads: 5
jino's Avatar
jino jino is offline Offline
Junior Poster in Training

Re: problem in header include

 
0
  #2
Apr 2nd, 2008
Use if(!session_is_registered('un')) instead of if(!isset($_SESSION['un']))

May be it will work,,

Jino.
We only have to do a very few things right in our life, so long as we don't do too many things wrong.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 107
Reputation: kings has a little shameless behaviour in the past 
Solved Threads: 2
kings's Avatar
kings kings is offline Offline
Junior Poster

Re: problem in header include

 
0
  #3
Apr 2nd, 2008
thank u for ur reply.still getting that same problem.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3,760
Reputation: nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough 
Solved Threads: 332
Moderator
Featured Poster
nav33n's Avatar
nav33n nav33n is offline Offline
Senior Poster

Re: problem in header include

 
0
  #4
Apr 2nd, 2008
Right after session_start, print $_SESSION['un'] and tell us what it prints.
Ignorance is definitely not bliss!

*PM asking for help will be ignored*
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 107
Reputation: kings has a little shameless behaviour in the past 
Solved Threads: 2
kings's Avatar
kings kings is offline Offline
Junior Poster

Re: problem in header include

 
0
  #5
Apr 2nd, 2008
the session value is not getting printed.
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 569
Reputation: ryan_vietnow is an unknown quantity at this point 
Solved Threads: 71
ryan_vietnow's Avatar
ryan_vietnow ryan_vietnow is offline Offline
Posting Pro

Re: problem in header include

 
0
  #6
Apr 2nd, 2008
then it simply means that $_SESSION['un'] is not existing.Where does this session comes from anyway?
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3,760
Reputation: nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough 
Solved Threads: 332
Moderator
Featured Poster
nav33n's Avatar
nav33n nav33n is offline Offline
Senior Poster

Re: problem in header include

 
0
  #7
Apr 2nd, 2008
Add whatever value to $_SESSION['un'] and then check again. I guess it has to have username ? When the user logs in, assign the username to $_SESSION['un'].
Ignorance is definitely not bliss!

*PM asking for help will be ignored*
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 107
Reputation: kings has a little shameless behaviour in the past 
Solved Threads: 2
kings's Avatar
kings kings is offline Offline
Junior Poster

Re: problem in header include

 
0
  #8
Apr 2nd, 2008
thanks. i got it....
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC