Music Player using Python

If you want to make a music player using core python then you have to follow below code.Here i am using this package pygame,tkintetr,mutagen. import os import pygame from mutagen.id3 import ID3 from tkinter.filedialog import askdirectory from tkinter import * root = Tk() root.minsize(300,300) listofsongs = [] realnames = [] v = StringVar() songlabel =

Set angular 2 dynamic page title

Create a title service class name like title.service.ts and put below code. import { Injectable } from ‘@angular/core’; import ‘rxjs/add/operator/filter’; import ‘rxjs/add/operator/map’; import ‘rxjs/add/operator/mergeMap’; import { Router, NavigationEnd, ActivatedRoute } from ‘@angular/router’; import { Title } from ‘@angular/platform-browser’; const APP_TITLE = ‘My App’; const SEPARATOR = ‘ | ‘; @Injectable() export class TitleService { constructor(

How to secure PHP web applications and prevent attacks?

1) Cross site scripting (XSS) XSS attacks happen when client-side code (usually JavaScript) gets injected into the output of your PHP script. This can be through the URL, but can also occur via a stored technique such as the database. // GET data is sent through URL: http://example.com/search.php?search=<script>alert(‘test’)</script> $search = $_GET[‘search’] ?? null; echo ‘Search

How to use PUT, PATCH, DELETE in Laravel?

If you want to use HTTP Methods like PUT, PATCH, DELETE in Laravel then follow below steps. In form section you have to put a field like below eaxample <form class=”form-control” action=”/update” method=”post”> {{ csrf_field() }} {{ method_field(‘PUT’) }} <input name=”id” type=”hidden” value=”{{ $user->id }}” /> <input name=”name” type=”text” value=”{{ $user->name }}” /> <input name=”email”

How to modify the nav menu structure or make custom menu structure in WordPress ?

If you want to modify the nav menu structure or make custom menu structure in WordPress then add this code to functions.php file. class Nav_Walker_Nav_Menu_sitemap extends Walker_Nav_Menu{ function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0){ global $wp_query; $indent = ( $depth ) ? str_repeat( “\t”, $depth ) : ”; $class_names =