tinyint in laravel migration

<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateReminderTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('reminder', function (Blueprint $table) {
            $table->id();
            $table->integer('user_id')->nullable();
            $table->date('date')->nullable();
            $table->time('time')->nullable();
            $table->text('description')->nullable();
            $table->tinyInteger('type')->nullable();
            $table->string('ip',150)->nullable();
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('reminder');
    }
}

double data type in Laravel migration

<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateExpenseTableTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('expense_table', function (Blueprint $table) {
            $table->id();
            $table->integer('user_id')->nullable();
            $table->double('amount', 10, 2)->nullable();
            $table->text('description')->nullable();
            $table->string('ip',150)->nullable();
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('expense_table');
    }
}

base64 encoded image example in php

          <?php
$imagedata = file_get_contents("https://websitename.com/images/fee_279_4_%E0%A4%AE%E0%A4%BE%E0%A4%98_%E0%A4%A8%E0%A4%B5%E0%A4%B0%E0%A4%BE%E0%A4%A4%E0%A5%8D%E0%A4%B0%E0%A4%BF.jpg");
          $base64 = base64_encode($imagedata);
          echo "<img src='data:image/jpeg;base64,$base64'>";
?>

enctype= multipart/form-data

HTML forms provide three methods of encoding.

  • application/x-www-form-urlencoded (the default)
  • multipart/form-data
  • text/plain

Work was being done on adding application/json, but that has been abandoned.

(Other encodings are possible with HTTP requests generated using other means than an HTML form submission. JSON is a common format for use with web services and some still use SOAP.)

The specifics of the formats don’t matter to most developers. The important points are:

  • Never use text/plain.

When you are writing client-side code:

  • use multipart/form-data when your form includes any <input type="file"> elements
  • otherwise you can use multipart/form-data or application/x-www-form-urlencoded but application/x-www-form-urlencoded will be more efficient

When you are writing server-side code:

  • Use a prewritten form handling library

Most (such as Perl’s CGI->param or the one exposed by PHP’s $_POST superglobal) will take care of the differences for you. Don’t bother trying to parse the raw input received by the server.

Sometimes you will find a library that can’t handle both formats. Node.js’s most popular library for handling form data is body-parser which cannot handle multipart requests (but has documentation that recommends some alternatives which can).


If you are writing (or debugging) a library for parsing or generating the raw data, then you need to start worrying about the format. You might also want to know about it for interest’s sake.

application/x-www-form-urlencoded is more or less the same as a query string on the end of the URL.

multipart/form-data is significantly more complicated but it allows entire files to be included in the data. An example of the result can be found in the HTML 4 specification.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8"/>
  <title>upload</title>
</head>
<body>
<form action="http://localhost:8000" method="post" enctype="multipart/form-data">
  <p><input type="text" name="text1" value="text default">
  <p><input type="text" name="text2" value="a&#x03C9;b">
  <p><input type="file" name="file1">
  <p><input type="file" name="file2">
  <p><input type="file" name="file3">
  <p><button type="submit">Submit</button>
</form>
</body>
</html>

static url with dynamic url htaccess

RewriteRule ^mr-upload?$ index.php?page=mr-upload  [L,QSA]
RewriteRule ^tagged/([^/]+)/page-(\d+)/?$ index.php?TagSearchResults&TagName=$1&Page=$2 [L,QSA]
RewriteRule ^tagged/([^/]+)/?$ index.php?TagSearchResults&TagName=$1&Page=1 [L,QSA]

Can Python replace PHP?

Short answer: no.

Long answer: nope.

How many applications do you think are written in PHP? How many man hours do you think will cost to replace those applications that millions if not billions of users use? Could you replace them with an exact copy (HTML rendered page that looks exactly like the original) of what they are using?

Realistically speaking, you’re going to waste more money and time to find such a project for switching every single user to a Python based alternative platform. And let’s not forget, those “alternative” platforms might not even work the same way nor work as efficiently as those that are written in PHP.

Not just that, you want to replace PHP? Then you’ll not only have to replace the code base, but also replace every single PHP installation on every single operating system ever created. macOS comes preinstalled with PHP, some Linux distros such as centOS come prepackaged with PHP.

People only usually mention Facebook or WordPress when they talk about PHP, but ever wonder what language PornHub is written in? You might want to double check. Not only that, some bank’s websites are written in PHP. Ever wonder how the game you play everyday has such a really nice and seamless [forum] experience? That’s because majority of them are written in PHP. A lot of popular gaming forums run on either vBulletin (written in PHP) or PHPBB or some other variant of PHP forum software.

http to https redirect htaccess wordpress

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !on           
RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

new line whatsapp api

The %0a represents the line break

<?php
$message='*जूम प्रोग्राम*
%0a
%0a
Time: Jan 18, 2020 08:00 PM
%0a
Join Zoom Meeting
%0a
https://us02web.zoom.us/j/455565566644?pwd=qwertyuiopgggg555554433
%0a
Meeting ID: 353545345575675756
%0a
Passcode: 8678768
%0a
%0a
*Note: यह लिंक सिर्फ आपके लिए है कृपया किसी और से शेयर ना करें*';
?>

whatsapp share link for website

<a class='blantershow-chat' target="_blank" href='https://api.whatsapp.com/send?phone=919555699081&amp;text=Hi&amp;source=HealthyDiet Professional'>
	<i class='fa fa-whatsapp'></i>
</a>
https://api.whatsapp.com/send?text=http://healthydiet.soatechnology.net/bmi_calculator
https://api.whatsapp.com/send?text=http://healthydiet.soatechnology.net/bmi_calculator&phone=123
<a class='blantershow-chat' target="_blank" href='https://api.whatsapp.com/send?text=http://healthydiet.soatechnology.net/{{ current_url }}'>
	<i class='fa fa-whatsapp'></i>
</a>
<a class='blantershow-chat' target="_blank" href="https://api.whatsapp.com/send?text=http://healthydiet.soatechnology.net/<?php echo $_SERVER['REQUEST_URI']; ?>">
	<i class='fa fa-whatsapp'></i>
</a>