Skip to content

Instantly share code, notes, and snippets.

@Anan5a
Anan5a / auto_link.php
Last active May 4, 2016 09:31
A short snippet to convert a linkable text from a text to an anchor link
<?php
class W_PDO_DB{
private $type,$host,$user,$pwd,$db;
protected $dbh;
function __construct($type,$host,$user,$pwd,$db) {
$this->type =$type;
$this->host =$host;
$this->user =$user;
$this->pwd =$pwd;
<!DOCTYPE html>
<html lang="en">
<head>
<title>Login..</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0">
<link href="css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<?php
echo $_POST['name'];
?>
<!DOCTYPE HTML>
<html>
<head>
<!--This is a html comment-->
<title>Page title</title>
</head>
<body>
<h1>I'm html !</h1>
</body>
</html>
<!DOCTYPE HTML>
<html>
<head>
<!--This is a html comment-->
</head>
<body>
<h1>I'm html !</h1>
</body>
</html>
<?php
/**
*
*/
$host="127.0.0.1"; // Host name
$username="root"; // Mysql username
$password=""; // Mysql password
$db_name="test"; // Database name
$tbl_name="student"; // Table name
<?php
function get_html($url)
{
$ch=curl_init($url);
$c_o_a=array(
CURLOPT_USERAGENT=> 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)',
CURLOPT_RETURNTRANSFER=>true,
CURLOPT_FOLLOWLOCATION=>1,
CURLOPT_AUTOREFERER=>false,
root@localhost:~/php7# ./cmd.sh
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking build system type... armv7l-unknown-linux-gnueabihf
checking host system type... armv7l-unknown-linux-gnueabihf
checking target system type... armv7l-unknown-linux-gnueabihf
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
<?php
//option one
$rand = substr(str_shuffle('a-Z strings'),5,5);
//2nd loop
for($i=0;$i<=5;$i++){
$rand .= chr(rand(99,155));
}