I have this migration file Schema::create(‘table_one’, function(Blueprint $table) { $table->increments(‘id’); $table->string(‘name’); $table->integer(‘table_two_id’)->…
Tag: php
Unable to send email using SMTP gmail config in codeigniter 3
Below are my code and I refer all examples in stack overflow and codeigniter user guide. still I unable to solve this public function send() { $config[‘protocol’] = ‘smtp’; $config[‘…
crawl and copy another sites content
I want to crawl and copy another site content (just text) and find specific content download links between specific tags . how can I do this? i am using Cpanel and Php Answer I am not sure about your question, but I think you want to do scrapping. Using PHP, you can use cURL for instance. That will load an
check file type in dropzone
I have following code to upload excel sheet using dropzone.js with certain condition such as maximum number of file is 1 and only excel type is accepted… when multiple file is uploaded with correct …
Splitting of array into multiple arrays
I have an array of dynamic length L1. I need to split this array into L2 number of arrays each having LEN[i] numbers from the original array. I have tried a lot of ways but nothing seems to be working. Any help would be greatly appreciated. Answer If you need such a variable array length of chunks then you ca…
Prevent InnoDB auto increment ON DUPLICATE KEY
I am currently having problems with a primary key ID which is set to auto increment. It keeps incrementing ON DUPLICATE KEY. For Example: From the description above, you’ll notice that I have 3 inputs in that table but due to auto increment on each update, ID has 86 for the third input. Is there anyway …
Laravel 5 command – Mandatory options
I am trying to write a laravel command but I can’t have the options to be mandatory. I do understand that the concept of option is being “optional” but I’d like to have a command in which it is clear which input you are inserting and in no particular order. i.e. I would like to achieve…
XAMPP send mail not working PHP
here are the details [php.ini] [sendmail.ini] i have checked smtp settings properly, but its still not working please suggest. Answer You have to configure SMTP on your server You can use the googles free SMTP server Pretty easy to setup too. You can try below as well. You can send mail from localhost with se…
WooCommerce – Custom thumbnails and default fall back image placeholder
I just want to insert a wrapper to the woocommerce_get_product_thumbnail I can see that my wrapper appeared but It doesn’t have a fall back image if there’s no image. How do I output the default …
Php include head with a link to the css dont work
I have started to use php a little bit. And got the first problem, which I can’t get rid of. I want my index.php with this code(in the head section): <?php require 'php/main/head….