php include page problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jogen143
Forum Newbie
Posts: 15
Joined: Tue Mar 25, 2003 2:51 am

php include page problem

Post by jogen143 »

hi,

I have a common page for navigation and member login which I have included 'include ("lhs.php")' this common page in every page in the site.

[u]Problem [/u]

When a user browse through the site and add items to the shopping cart and try to login to the site afterwards (since the login page is a include page it appears in the shopping cart pages as well) the variables used in the shoping cart were lost.

The login form (include page) calls it self and process member login. When user enter login details and submit the login form, the page reloads (as any other form) but the details in the main page (shopping cart details are lost).

I want to keep the variable on the page even if the page reloads (by user activate the login form).

Can anyone help on this

Thanks guys
User avatar
samsbox
Forum Newbie
Posts: 4
Joined: Mon Apr 19, 2004 2:52 am
Location: Telford, UK

cookie

Post by samsbox »

You have probably thought of this, but have u tried storing the variable as a cookie (or a secure cookie if the information is sensitive)?
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post by Gen-ik »

As well as the Cookies option you could always use a Session. This will keep any variables added to the Session 'active' until you end the Session with PHP or the user closes their browser.
Post Reply