Category "php"

PHP - How to protect the URL after logging in from copy paste

I have created a login script and the user, after entering his username and password, is redirected to the main page of the site named main.php, if of course en

Composer Warning: openssl extension is missing. How to enable in WAMP

Trying to install Composer dependency management tool on Win7/64 + WampServer 2.2 via the Setup Installer and I am getting the following message: The openss

Find out the name of the last script that included the current one

Let's say I have 3 scripts, the main/top one which includes second which in turn includes a third. Let me draw that so it be clear. [top level script] -> [se

str_word_count() function doesn't display Arabic language properly

I've made the next function to return a specific number of words from a text: function brief_text($text, $num_words = 50) { $words = str_word_count($text,

Convert date and time to Jalali in Laravel

I want to change the time and date calendar to Jalali (Shamsi calendar used in Iran) in my system. How can I do this? "language_title" => "English",

Jquery DataTables: Data not displaying in table via Ajax

My problem is that Jquery DataTables is hanging at Loading and will not display any data from the php script: Here is my HTML: <!-- Default box --> &l

Convert date and time to Jalali in Laravel

I want to change the time and date calendar to Jalali (Shamsi calendar used in Iran) in my system. How can I do this? "language_title" => "English",

How to unlink image from folder?

I am currently working on shopping cart.let me quick expain whats happening in product_info.php page. in product info page products information in displayed su

How to hide products with price higher than 1 on WooCommerce shop and archives pages

I'm using this code to hide products on the Shop Page where the product price is higher than 1. However, without the desired result. Where does it go wrong? M

Laravel 5.5 change unauthenticated login redirect url

In Laravel < 5.5 I could change this file app/Exceptions/Handler to change the unauthenticated user redirect url: protected function unauthenticated($reques

Override default Auth routes in Laravel 7

I need to custom routes of Auth::routes();, I can not find them, try search in Router.php Vendor\laravel\framework\src\Illuminate\Routing\Router.php But I

WAMP/Wordpress - cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received

I have been stuck with this error for quite some time now. Earlier I got this error on godaddy and asked it over here. Now I'm getting it on hostinger shared ho

What is PHP's equivalent of JavaScript's "array.every()"?

I'm currently trying to port some JavaScript over to PHP. However, I can't seem to find PHP's equivalent to the JavaScript array.every() function. I found PHP's

Pages are working fine on localhost but not running on the hosting server

I created a PHP website which is working fine on my localhost but when I uploaded the same code on the server, it is showing me blank pages on the server. Prob

How to add script to Leadpages?

I have found a UTM Tracking code script that I like to use on my own websites. I will try and explain how it works. A visitor lands on the website: The Link

Using PHP to connect to a remote MSSQL database

My local environment is WAMP. For a few pages i have to access a remotely hosted MSSQL DB, run queries and get back results. I have been supplied the following

Array to string conversion

$replacements = array( '{order_id}' => $order_id, '{site_url}' => $settings["site_url"], '{email}' => $user_email, '{last_name}' =&g

How to programmatically find public properties of a class from inside one of it's methods

I've got a class Foo with public and protected properties. Foo needs to have a non-static method, getPublicVars() that returns a list of all the public propert

PHP | "The requested PHP extension bcmath is missing from your system."

Greetings fellow developers, I am trying to use composer for a PHP project of mine on a development server I recently booted up and for some reason I am unable

MySQL order by field in Eloquent

When I want to define a custom sort order in a MySQL query I can do something like this: ORDER BY FIELD(language,'USD','EUR','JPN') What would be the Eloquen