0

I seem to be getting an error in my PHP file. It was working earlier but now it just doesn't seem to work

The error I get is:

Notice: Undefined index: login_user in C:\wamp\www\catalogue.php on line 28

and Line 28 is:

Welcome, <?=$_SESSION['login_user'];?>! <br> <a href="logout.php">Logout</a>

Not sure why its giving me this error

The session login_user is created in a login page which is then called in the catalogue page. For some weird reason it seems to trigger whenever I try to empty my cart.

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
resontant81
  • 39
  • 2
  • 3
  • 8
  • 1
    There is not a heckuva lot to go on here, but my bet is that `session_start()` isn't at the top of the page. That's just a guess since my crystal ball is out for maintenance. Can you share some more of the page's code? – Jay Blanchard Mar 11 '15 at 16:27
  • Its the first thing i have just after an opening php tag full code is here: http://codepen.io/anon/pen/wBYgyg?editors=100 – resontant81 Mar 11 '15 at 16:27
  • What sets `login_user`? – Jay Blanchard Mar 11 '15 at 16:29
  • Thats set in a different file which stores the users usersname in the session. link: http://codepen.io/anon/pen/ZYqLxo?editors=100 – resontant81 Mar 11 '15 at 16:31
  • @JayBlanchard its weird. i seem to get the error whenever i click on "empty cart" – resontant81 Mar 11 '15 at 16:49
  • You need to ask a new question with that as your issue. Make sure to include the relevant code in your question, not hosted at some other site. – Jay Blanchard Mar 11 '15 at 16:50

0 Answers0