In my shop page, for each product I have cart quantities that the user can change without add to cart button (it’s with display none and activated by js). my problem is that if a user changed item quantity in single product page and navigated back into shop page it show the wrong quantity from cache. Ri…
AES-256-GCM unavailable in PHP ext-sodium on M1 Macbook
Recently at work we’ve had a new hire to work on a project of ours that utilizes AES-256-GCM encryption and decryption via PHP’s sodium extension. Since we all use Macbooks, the new employee received a 2020 Macbook Pro with M1 chip. The first attempt at getting the aforementioned project up and ru…
Force file download with header is corrupting file
So I am using PHP headers to force download a file, but when the file is saved it gets corrupted because for whatever reason the HTML code from the download page is also added into the file code/…
How to split text string in PHP (Song – Artist)
I have this bit of PHP ?> I want it to show on my page as: Song Artist How would I make the song appear in bold and what would I put in place of the ” – ” to make a line break instead? Answer Assuming you want to generate some HTML that can be picked up by a
How to check the weight of product in cart based on meta_key?
I am looking for a solution to check the weight in the cart based on meta. for example, it prints: : 5kg in your basket is Cold and Hot 2.5kg in your basket is other I use the following loop to check the meta_key: Then after checking products with a special meta, I want to calculate the weight. Would you
Using Iterator and update_user_meta() to Dynamically Add Checkboxes to profile.php and edit-user.php in WordPress Using an Array
So, I’ve been pulling my hair out over this for longer than I’d care to admit. I am trying to create a bunch of checkboxes in profile.php and user-edit.php for a plugin that is populated by an array. …
PHP radio buttons next to each other in second for loop
I am trying to get radio buttons to display next to each other, but it is creating 2 lines or radio buttons instead of all 5 next to each other. $mcqnum is a value I am getting from another PHP page. …
HTML Image Slider not on Heroku
my image slider isn’t working on heroku but when I run the code on localhost it works fine heroku=> https://phpstore-website.herokuapp.com/ github repo=> https://github.com/verma-tanishq/…
Make certain part of string bold using preg_replace()
I have a string of a comment that looks like this: **@First Last** rest of comment info. What I need to do is replace the ** with and so that the name is bold. I currently have …
PHP – Check checkboxes if id is in database, checks first but not next ones?
I need to check the checkboxes that id is equal to id from user on database, Like: User with ID 1 Permissions table: 1,2,3,4,5 User 1 has permissions of 1,3 and 4 USER PERM. 1 – 1 1 – 3 1 -…