Category Archives: PHP

How to Work Mpdf Workable in Php 7 ?

pdf_mpdf

If you use an old version of PHP in your local system and you integrate the mpdf in that old version. after you change your PHP version to the latest version and mpdf is not working then simply follow our below steps and you will get the mpdf working in your latest PHP version.

Step 1)

Click here to download the mpdf.

Step 2)

Include the mpdf

require_once _DIR_ . ‘/MPDF/vendor/autoload.php’;

instead of

require_once( ‘mpdf/mpdf.php’);

Step 3)

Just change your code to

$html = “Your html code here”;
$mpdf = new \Mpdf\Mpdf([‘mode’ => ‘utf-8’, ‘format’ => ‘A4′,’0′,”,0,0,0,0,’margin_header’ => 0,’orientation’ => ‘P’]);
$mpdf->setAutoTopMargin = ‘stretch’;
$mpdf->setAutoBottomMargin = ‘stretch’;
$mpdf->WriteHTML($html);
$mpdf->Output();
exit;

Instead of

$html = “Your html code here”;
$mpdf=new mPDF(‘utf-8’, ‘A4’, 0, ”, 0, 0, 0, 0, 0, ‘P’);
$mpdf->setAutoTopMargin = ‘stretch’;
$mpdf->setAutoBottomMargin = ‘stretch’;
$mpdf->WriteHTML($stylesheet, 1);
$mpdf->WriteHTML($html);
$mpdf->Output();

Step 4)

Now your mpdf is working in php 7 and above version.

Register Custom Sidebar in WordPress

Customsidebar

If you are new in WordPress and don’t know how to register the custom sidebar and how to get the custom sidebar value on any page then simply follow the tutorial steps and you can get your custom sidebar.

Step 1)

Copy the below code in your functions.php for register a new custom sidebar.

register_sidebar( array(
‘id’ => ‘ID of your sidebar without space and special character’,
‘name’ => ‘Name of your sidebar without space and special character’,
‘description’ => __( ‘Enter Placeholder Text Here’, ‘text_domain’ ),
) );

Step 2)

Now, You can view the sidebar in you wp-admin widget section.

Step 3)

If you need to get that new custom sidebar value in the wordpress pages then copy the below code with starting and ending of php code in your pages.

dynamic_sidebar( ‘Your custom register sidebar id’ );

Step 4)

Now if you put any widget inside the custom sidebar it will display the widget where you put the code which is define in the step 3.

How to set default editor in FileZilla?

maxresdefault

You has no idea to setup the default editor in filezilla when you view/edit page then simply use this tutorial. You want setup a default editor to your Filezilla, then follow the below steps.

Step 1)

Open the Filezilla
fillezilla

Step 2)

Open the edit menu -> preference from the top left corner
fillezilla preference

Step 3)

Open the “Filetype associations” and copy paste the code as below if you use sublime as defult editor.
“php /usr/bin/subl”
If you use another editor like NetBeans, dream viewer, notepad++ then you need to find their extension and set in the “Filetype associations”. so your default files will open in that software.
FileZilla Setting

How to Install wordpress?

Wordpress

If you are new in WordPress and don’t know how to install the WordPress in your local system or live system then follow the below steps and get newly installed WordPress.

Download Latest WordPress

You can download the latest WordPress version from this link https://wordpress.org/download/

Step 1)

Abstract the zip where you need to set up the WordPress, if you need to set up in your local server then make a new folder which is your project name like “Blogging” and put all files and folder into the new folder from the abstract zip folder. if you need to set up in live server then just copy all files and folder into the hosting panel from the abstract zip folder.

Step 2)

Now make one new empty database to your local or live system. like “blogging”.

Step 3)

Run the URL in the browser. if you set up your WordPress in the local server then run URL in the browser like “http://localhost/blogging”. if you set up your WordPress in the live server then run the URL in the browser like “http://blogging.com”.

Step 4)

wordpress-install-step4.png

In your browser, you can see one form like below.

  • Enter your database name in the first field which u make in the database like “blogging”.
  • Enter your database username and password in the next two fields.
  • In the database host, if you use local server then put hostname as it is if you use live server then check your hostname from the database and insert that hostname in that fields.
  • If you want another prefix then you can enter in the prefix section otherwise put as it is.
  • Submit the form and you can get new form as see in the step 5.

Step 5)

wordpress-install-step5.png
  • Now enter your website title
  • Enter your username and password in the next two fields. which is your WordPress admin login access.
  • Enter your email address where you can get notification from the wordpress.
  • Click on the install wordpress button.

Step 6)

Now your wordpress was completed.