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> | |
<style> | |
form { | |
border: 3px solid #f1f1f1; | |
} | |
input[type=text], input[type=password] { | |
width: 100%; | |
padding: 12px 20px; |
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
Change the config file base url as- | |
$config['base_url'] = 'http://localhost/'; | |
after that change the database pathin database.php file in config folder as -- | |
'hostname' => 'localhost', | |
'username' => 'root', | |
'password' => 'root', | |
'database' => 'login', | |
'dbdriver' => 'mysqli', | |
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 | |
$servername = "localhost"; | |
$username = "username"; | |
$password = "password"; | |
try { | |
$conn = new PDO("mysql:host=$servername;dbname=myDB", $username, $password); | |
// set the PDO error mode to exception | |
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | |
echo "Connected successfully"; |
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 | |
$servername = "localhost"; | |
$username = "username"; | |
$password = "password"; | |
$dbname = "myDBPDO"; | |
try { | |
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password); | |
// set the PDO error mode to exception | |
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
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
In this example, when a user types a character in the input field, a function called "showHint()" is executed. | |
The function is triggered by the onkeyup event. | |
eg----- | |
<html> | |
<head> | |
<script> | |
function showHint(str) { | |
if (str.length == 0) { | |
document.getElementById("txtHint").innerHTML = ""; |
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> | |
<head> | |
<script> | |
function showUser(str) { | |
if (str == "") { | |
document.getElementById("txtHint").innerHTML = ""; | |
return; | |
} else { | |
if (window.XMLHttpRequest) { | |
// code for IE7+, Firefox, Chrome, Opera, Safari |
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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ edge/index.php?/$1 [L] | |
</IfModule>z |
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
// first call the following log() function in your controller | |
eg :- | |
function log() | |
{ | |
//$this->load->helper(array('url')); | |
$this->load->view('login_view'); | |
} | |
// this function call through the form after submit the login form | |
eg: | |
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'); | |
include getcwd()."/application/config/config.php"; | |
$base_url = $config['base_url']; | |
?> | |
<link href="<?=$base_url?>style/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"> |
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
// insert into stud table value using codegnitor | |
$data = array( | |
'roll_no' => ‘1’, | |
'name' => ‘Virat’ | |
); | |
$this->db->insert("stud", $data); | |
// Update query using codegnitor |
OlderNewer