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 | |
require_once "db.php"; | |
$sth=$db->prepare("select * from users"); | |
$sth->execute(); | |
while($row = $sth->fetchObject()) | |
{ | |
$id=$row->id; | |
$fname = $row->fname; | |
$lname = $row->lname; | |
$username = $row->username; |
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 | |
try{ | |
$db = new PDO("mysql:host=localhost;dbname=lablnet_cms", "root" ,""); | |
$db->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION); | |
$db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC); | |
}catch(Exception $e){ | |
die($e->getMessage()); | |
} | |
?> |
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 | |
function sanitizeInput ($inputText){ | |
$inputText = strip_tags($inputText); | |
$inputText = str_replace(" ", "", $inputText); | |
return $inputText; | |
} | |
function sanitizeString ($inputText){ | |
$inputText = strip_tags($inputText); |
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
<h1>Before Using Zest Framework</h1><p> | |
Before using Zest Framework it is important to understand why it is a good idea to use the Zest Framework.</p><p>As for PHP, there are many PHP frameworks available nowadays, so the question is raised as to why we should use ZestFramework.</p><p>The main purpose of Zest framework is to provide a very lightweight framework without any external dependencies except core and autoloader. So in this case Zest Framework is very light in weight the core files size of zest framework is less then one 1MB | |
</p><div><h1>Key benefits</h1> | |
Zest is a simple/light weight yet powerful PHP MVC framework for rapid application development that is suited for small to medium and large scale apps and APIs. | |
<h2>Advance Routing system</h2> | |
Zest Framework provides advance routing system | |
<ol> | |
<li>Flexible regular expression routing</li> |
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 | |
use Lablnet\Identicon; | |
require 'vendor/autoload.php'; | |
$Identicon = new Identicon; | |
//$Identicon->getInstance()->setBlock(2); //change block | |
$imageDataUri = $Identicon->getImgDataBase64('php'); | |
echo "<img src=".$imageDataUri." />"; |
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
<?=view('nav')?> | |
<div class="overlayexp"> | |
<div class="expmodal"> | |
<div class="modelhead"><button id="closeexp">x</button><h4>Add Experience</h4></div> | |
<center><form > | |
<input type="text" id="" placeholder="title" class="signupinput" required> | |
<input type="text" id="" placeholder="Company" class="signupinput" required> | |
<input type="text" id="" placeholder="Location" class="signupinput" required> | |
<select name="" id="expyears" class="signupinput"> |
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 | |
function isPrime($n) | |
{ | |
for ($i = 2; $i < $n ; $i++) { | |
if ($n % $i === 0){ | |
return false; | |
} | |
} | |
return true; |
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 | |
function hexTDec($hex) | |
{ | |
$decimal = 0; | |
$exp = 0; | |
$len = strlen($hex) - 1; | |
for ($i = $len; $i >= 0 ; $i--) { | |
if ($hex[$i] <= 9 && $hex[$i] >= 0){ | |
$decimal += $hex[$i] * ( 16 ** $exp); | |
} |
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
#include <iostream> | |
#include <string.h> | |
using namespace std; | |
int hex2dec(string str); | |
int power(int exponent, int base); | |
int count(string s); | |
int main () | |
{ | |
string hexa; |
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
//By Muhammad Umer Farooq | |
#include <iostream> | |
namespace ReverseNumber | |
{ | |
int rem = 0; int rev = 0; | |
int for_loop(int n) | |
{ | |
for (n; n != 0; n /= 10) { // for (n; n > 0; n /= 10), for (;n != 0; n /= 10) | |
rem = n % 10; |
OlderNewer