This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html lang="en"> | |
<head> | |
<title>Show preview when select an image via file input </title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> | |
</head> | |
<body> | |
<input type="file" name="image_file" id="image_file"> | |
<br> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(function($) { | |
function fixDiv() { | |
var $cache = $('#getFixed'); | |
if ($(window).scrollTop() > 100) | |
$cache.css({ | |
'position': 'fixed', | |
'top': '10px' | |
}); | |
else | |
$cache.css({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Here is our upload script resides | |
//Check whether the form really submits | |
if($_SERVER["REQUEST_METHOD"] == "POST"){ | |
if(!empty($_FILES['image']['name'])) { | |
$uploadDir = './uploads/'; | |
$uploadFilename = $uploadDir.basename($_FILES['image']['name']); | |
//Check extension | |
$ext = pathinfo($filename, PATHINFO_EXTENSION); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>File Upload Form</title> | |
</head> | |
<body> | |
<form action="upload.php" method="post" enctype="multipart/form-data"> | |
<div class="form-control"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
defined('BASEPATH') OR exit('No direct script access allowed'); | |
class Contact extends CI_Controller { | |
/** | |
* Index Page for this controller. | |
* | |
* Maps to the following URL | |
* http://example.com/index.php/welcome |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<link rel="icon" href="../../../../favicon.ico"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function posts(Request $request) { | |
$id = $request->input('id'); //returns Ony Id value | |
$query = $request->all(); //Returns all inputs | |
//Another way to do it | |
$id = Input::get('id'); //returns Ony Id value | |
$query = Input::all(); //Returns all inputs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Load the theme stylesheets | |
function active_theme_styles() | |
{ | |
// Load all of the styles that need to appear on all pages | |
wp_enqueue_style( 'custom', get_stylesheet_directory_uri() . '/css/custom.css' ); | |
// Conditionally load some thing in the home page | |
wp_register_style( 'slideshow', get_stylesheet_directory_uri() . '/css/slideshow.css' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="body"> | |
<?php | |
foreach($countries as $country) { | |
echo $country['country_name'] . " - " . $country['country_code'] . "<br>"; | |
} | |
?> | |
<p><?php echo $links; ?></p> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
defined('BASEPATH') OR exit('No direct script access allowed'); | |
class Country extends CI_Controller { | |
public function __construct() | |
{ | |
parent:: __construct(); | |
$this->load->model('Country_model', 'country'); | |
$this->load->library("pagination"); |