Skip to content

Instantly share code, notes, and snippets.

public function boot()
{
if(env('APP_ENV') == 'production') {
\URL::forceScheme('https');
}
}
<link rel="dns-prefetch" href="//fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
<script defer src="{{secure_asset('js/all.js')}}" crossorigin="anonymous"></script>
<!-- Styles -->
<link href="{{secure_asset('css/app.css')}}" rel="Stylesheet">
<link rel="stylesheet" href="{{secure_asset('css/intlTelInput.css')}}">
<link href="{{secure_asset('css/select2.min.css')}}" rel="stylesheet" />
</head>
<body>
class TrustProxies extends Middleware
{
/**
* The trusted proxies for this application.
*
* @var array|string
*/
protected $proxies = '*';
/**
--
-- Table structure for table `tbl_blog`
--
CREATE TABLE IF NOT EXISTS `tbl_blog` (
`blog_id` int(11) NOT NULL AUTO_INCREMENT,
`blog_title` varchar(300) NOT NULL,
`blog_link` varchar(100) NOT NULL,
PRIMARY KEY (`blog_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=40 ;
--
<?php
$connect = mysqli_connect("localhost", "root", "", "auto_refresh");
if(isset($_POST["submit"]))
{
if(!empty($_POST["search"]))
{
$query = str_replace(" ", "+", $_POST["search"]);
header("location:index.php?search=" . $query);
}
}
CREATE TABLE `tbl_post` (
`post_id` int(11) NOT NULL,
`post_name` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
<?php
//fetch.php
$connect = mysqli_connect("localhost", "root", "", "auto_refresh");
$query = "SELECT * FROM tbl_post ORDER BY post_id DESC";
$result = mysqli_query($connect, $query);
if(mysqli_num_rows($result) > 0)
{
while($row = mysqli_fetch_array($result))
{
echo '<p>'.$row["post_name"].'</p>';
<?php
//insert.php
if(isset($_POST["post_name"]))
{
$connect = mysqli_connect("localhost", "root", "", "auto_refresh");
$post_name = mysqli_real_escape_string($connect, $_POST["post_name"]);
$sql = "INSERT INTO tbl_post (post_name) VALUES ('".$post_name."')";
mysqli_query($connect, $sql);
}
<html>
<head>
<title>Auto Refresh Div Content Using jQuery and AJAX</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<style>
body
{
margin:0;
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]