I’m using geoplugin php to get the country and ip of visitors on my site, but its returning the ip and country of hosting server instead of user who visit the site, I’m using Hostinger as my hosting. $…
Count only top level WooCommerce product categories form custom shipping calculations
I am using Increase Shipping cost per categories count found in WooCommerce cart answer code from my previous question. How to exclude subcategories from the array of product categories Ids, to keep …
How can I hide php file extension using htaccess?
this line does hide the extension successfully. Now I do not want the page with the extension to be accessible; if one tries to access that page with the extension, it must show an error. Only the one that has the extension hidden that must be accessible. Answer @MrWhite gave an answer that showed how to thro…
Add nbsp; in php
I have this How can I add a non-breaking space between the » and the term name? Answer Try This
PHP calendar to block some not available dates
I’m designing a little PHP calendar for a little booking system. The final feature is to block some not available dates, that I have stored in a PHP array. What is the best way to achieve this? Please I need some recommendations about how to do this. Thanks if I have an array in php with dates in this f…
How to separate array from nested arrays with MongoDB and PHP aggregate?
I would like to get the distinct code_y values, and I use below code, the output is equal to select distinct code_y from table_x, $res = $db_x->command ( array( “aggregate&…
php $image = get_field( ‘image’ ) // if // else
I need an inquiry if there is no image that an alternative image is used. the crazy thing is that it works on four out of 18 images. I think I have an error in the “else query” somewhere. Because if I swap the defalut image with the actual product image, then it works .. but of course that is
Unable to decode JWT tokens PHP
I tried to decode the given token with the code below. The key is supposed to be base64 encoded. However when I attempt to decode it tells me I have invalid signature. The token is generated from a system using Java and I have to decode it in PHP. Token: Decoding script It decodes just fine on jwt.io with the
Laravel I added morphmany SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘staff.staff_id’ in ‘field list’
I store the data correctly but when I try to get a data in edit function it shows me this error SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘staff.staff_id’ in ‘field list’ (SQL: select users.*, staff.staff_id as pivot_staff_id, staff.user_id as pivot_user_id, staff.staff_ty…
Efficient Site Structure
I need to make some websites for work. I am new to it, so I am going pretty basic with bootstrap. There are a number of pages that will be identically structured, just with different text and links. …