Category "php"

Best way to scrolldown onpageload

I have the following code: <script type="text/javascript"> window.onload = function () { window.scrollBy(0, 100); } </script

PHPExcel_IOFactory::createWriter causes wrong behaviour

After having created a PHPExcel program, the final step consists of saving the worksheets, to do that, I want to apply these rules so as to generate the file in

PHP returning an error message and false

I have a very simple PHP function to check log-in function check_login($user, $pass) { if(!isset($user) || $user == '') { return 'Please enter a v

In Moodle Certificate not displaying course completion date

I am using Moodle and having problem with the plugin certificate builder I had created my template correctly, but now that learner are starting to complete the

Multiple order by in WooCommerce

I want to order my products in category page by average rating (DESC) and then by price (ASC). | id | avgrating | price | | 1 | 4 | 10

Add New Parameter to Existing URL using htaccess

I have a url like below http://filespecification.phpnet.us/index3.php But i want to add an additional parameter to this url like below. http://filespecifica

Laravel Carbon throws error The format separator does not match

I'm, trying to format a date into (Dayname Date Month) and I'm using Carbon for this but it return an error Carbon The format separator does not match here is a

DEbian squeeze upgrade PHP 5.3 to PHP 5.5

On Debian (Squeeze), I need to upgrade from PHP 5.3 to PHP 5.5. I tried those commands : apt-get update; apt-get install php5; also adding : echo "deb http:/

Accessors (Getter) & Mutators (Setter) On a Pivot Table in Laravel

I have a pivot table that connects users to workspaces. On the pivot table, I also have a column for role, which defines the users role for that workspace. Can

Warning file_get_contents () failed to open stream: HTTP request failed! HTTP/1.0 402 Payment Required

I got this error today but before that, my code was working fine. The code is working fine on localhost but I get error on my website Here is the line of code

Auto email response after enquiry form not working, 'emailid' argument undefined?

I need to add auto response email on my forms. This requires us to add an argument to the [cd-iframe] directive specifying which email needs to be sent. This al

Create a zip file and download it

I am trying to download a 2 files by creating the zip file on local-server.the file is downloaded in zip format but when i try to extract it.it gives error: En

Laravel failing now that I moved to public address

I developed a project using laravel and the php artisan serve. Everything was working as expected. I have since installed apache and have the apache webserver

Woocommerce product attributes with hierarchy like categories

Faced the task of making a filter based on the attributes of the product. I need to make a hierarchy of attributes like the product categories. Can this be real

php echo remove slashes from url [duplicate]

I have experienced a strange problem with the slideshow on our corporate site and i haven't figured what is whong. After Joomla updated to 3.7

Yoast SEO (WordPress Plugin) - Get plugin generated data manually

I wanted to get the Yoast SEO generated data manually, see example code below This data is being generated by Yoast and automatically add it inside the head ta

How to pass data to all views in Laravel 5?

I want to have some default data accessible in all views in my Laravel 5 application. I have tried to search for it but only find results for Laravel 4. I have

Detect a fetch request in PHP

How can I detect requests from the Fetch API in PHP? I am currently using the approach below to detect an AJAX request: $context['isAJAX'] = (!empty($_SERVER['

Access denied when making connection from php container to mysql container

I’ve been searching the web for hours but do not find any solution to my problem. I have 3 containers: - nginx - php - mysql They are all connected to th

How to replicate ASP Classic SHA512 Hash function in PHP

I'm currently rewriting an asp classic site in PHP, everything so far has been simple until I reached the password hashing function. In PHP I've used hash_hmac