Skip to content

Tag: php

hide the content of the page if the user is not logged in

I am trying to hide the contents of the page if the user is not logged in, everything is now hidden except the nav. It doesn’t apply the css code that I used. as you can see in the code I have added .dipsplay-custom: none; if the user session is not set so in every parent I added display-custom the

How to return only the last counter value in PHP for a custom field

How do you fetch the last value only from the following code. At the moment, this code prints all the rows but I just need to echo the last number only. I am using a custom repeater field that allows multiple uploads so I need the $counter variable to return the last number which I can then concatenate with D…

Laravel 8 Named error bag during registration

Before you mark this question as a duplicate of this question, first understand that this question is based on Laravel 8 while the former is on Laravel 5.4 which handle the auth differently. I would like to add a named error bag on laravel validation during registration. I am using the default laravel auth Be…

CS CART API Login Post URL

There is an auth attribute having 2 parameters, but it didn’t work http://example.com/api/auth?email=example@gmail.com The output of the URL is Also, the redirection_url parameter is not working. Please help me fix this. Answer You need to provide Auth Email Auth Password in Basic Oth in Postman

String and number in for each

I have this code: Expected result (to put as text in another PHP file): $Avroeger = 8.8; $Bvroeger = 5.5; Actual result: (where the 8.3 and 5.7 are the old values of $Avroeger and $Bvroeger) 8.3 = 8.8; 5.7 = 5.5; Anyone who can help? Thank you in advance! Answer You are doing the appending wrong. Do it as sho…

How to save data into cookie in PHP from PDO

I need some help as have been stuck here for a while, please bear with me as am a rookie and perhaps this might be simple to a seasoned developer, basically am trying to save data into a cookie so that i only hit the database once, after that, I want when i reload the page to get my data

New lines HTML if value changed in MySql Output via PHP

This is the HTML/PHP , I am using to display some data. and I am getting the data like this from the db. This outputs a single table with all the data. My question is , is there a way to break the single table into tables when the value of postid changes? It goes like..is 1 for x number