I am trying to make an e-commerce website and I can’t quite figure out how to get the cart to function. I am able to add amounts to the cart before purchase but I want it to delete the item from the cart when the quantity is set to 0. Here is the cart variable that creates a table of
Tag: session-variables
For some reason. IF statement is working….Ive tried If/else with no luck either [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 7 months ago. Improve this question
PHP Session discrepancy between development (localhost) and hosted service
I’m implementing a google sign-in feature which uses PHP sessions across pages to determine whether the user is in fact signed in. This works perfectly on my local machine. When I upload to my hosted server (happens to be Google Cloud) and adjust the client ids accordingly and then sign in as normal, the sign-in process completes, but the user
PHP-Script to check if user is logged in not working as expected
Problem I am building a panel for an admin for a web system. I have to make sure that hackers, if they have knowledge of the names of the files on this server cannot access certain pages directly without at least logging in. Now after looking at similar php code used to achieve this, i discovered that after you have
PHP I want to restrict a button in the navbar to Admin users only
Currently making a blog websit and wanted to add an administrator locked button in the navbar that allows them to delete users there is onlly 1 Admin whos username will be “Admin”. Right now I have something like this: I keep getting this error Fatal error: Cannot use isset() on the result of an expression (you can use “null !==
Unable to send SESSION DATA to email via PHPmailer
I am trying to send an email upon successful order placed on my website, however the email delivers but the details (WHICH ARE STORED IN THE SESSION VARIABLE $_SESSION[“cart”]) doesn’t send …
PHP – Unidentified index in error log even though using isset to check for session variable
I am running the following check in PHP (in a Slim middleware) to make sure that a certain session variable exists: However, my error log is swamped with the following: What can I do to have this not show as an error? I found a solution here: PHP: Notice Undefined index even using isset but my case is different as
Why sessions are not working in home directory of website
In my website, After login the sessions are being set but they are not working in files of home directory but they are working in the other directories like /admin. Maybe its some problem of my robots.txt file. this is the code of robots.txt file- Code of my navigation bar – The place where I am setting sessions in login.php
Session gets destroyed after page refresh
Login.php Index.php I made a Login script which opens, if the password is correct, the Index.php site. When first opening the Index.php site via the Login script everything works fine and the session is set. But after I refresh the page the sessions gets destroyed and is not set. So how can I save the session, so it’s not getting
How to save PHP session after browse closing? (without separate cookies)
There are a lot of Stack Overflow questions which advise using separate cookies to keep session parameters, but I don’t want to store any additional cookies on the client side. At the moment I have a new session with empty session parameters after each browser restart. Is there any way to keep the PHP session active after each browser restart?