Skip to content

Instantly share code, notes, and snippets.

function url2breadcrumb($url,$include_base=1,$home_url=false){
if(empty($url)){
return;
}
$base = parse_url($url);
$base = $base['scheme'].'://'.$base['host'].'/';
$crumbs = rtrim(parse_url($url,PHP_URL_PATH),'_');
$crumbs = array_filter(explode("/",$crumbs));
$link = '';
<?php
/*-----------------------------------------------------------
| @Visitor Counter without using database
| github: https://gist.github.com/RahulSaini91/a09c8f8e6cebf4c66e227699f5860df3
| Save visiter number in cookies
|
| Access the visitor count
| echo the_counter();
|
$mail = new PHPMailer(); // create a new object
$mail->IsSMTP(); // enable SMTP
$mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
$mail->SMTPAuth = true; // authentication enabled
$mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for Gmail
$mail->Host = "smtp.gmail.com";
$mail->Port = 465; // or 587
$mail->IsHTML(true);
$mail->Username = "email@gmail.com";
$mail->Password = "password";
<?php error_reporting(0); session_start(); $input = input(); date_default_timezone_set('Asia/Kolkata'); $mail = array();
/*
******************************************
********* READ FULL TUTORIAL AT: ********
***** http://tutorials.weforit.com ******
******************************************
*/
/*
@RahulSaini91
RahulSaini91 / scripts.js
Created May 3, 2018 10:27
Movie Project
//functions
function setCookie(cname, cvalue, exdays) {
var d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
var expires = &quot;expires=&quot;+ d.toUTCString();
document.cookie = cname + &quot;=&quot; + cvalue + &quot;;&quot; + expires + &quot;;path=/&quot;;
}
<link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<style>
body{
background:#efefef;
}
.text-color{
color:#fff;
@RahulSaini91
RahulSaini91 / CSS - Basic Utility
Last active November 27, 2017 06:08
The CSS has basic customization class e.g: Font Bold, italic, underline and etc.
<style>
/* customize font style */
.text{
font-size:14px;
font-family:times new roman;
}
.text-normal{
font-weight:normal;
text-decoration: none;
font-style: normal;
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
## OPTION 1 ##
## Shared on http://www.rahulsaini.co.in/blogs ##
## Please try another method if it is not working ##
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
@RahulSaini91
RahulSaini91 / [www.rahulsaini.co.in] - Apache htaccess: Add Cache-Control for Browser Caching
Last active May 24, 2017 16:12
Increase the speed of your website by adding apache cache control into your server's htaccess file
RewriteEngine on
## PLEASE VISIT HERE FOR FULL TUTORIAL / DETAILS OF APACHE htaccess CACHE CONTROL ##
## http://www.rahulsaini.co.in/blogs ##
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
## SET Caching for Images ##
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"