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
index.php | |
-------------------------------------------------------------------------------------------------------- | |
<?php | |
$page = 'pages/'.$_GET[id].'.php'; | |
(!file_exists($page) == 0) ? require_once $page : require_once 'pages/home.php'; | |
?> | |
--------------------------------------------------------------------------------------------------------- | |
--------------------------------------------------------------------------------------------------------- | |
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
#!/usr/bin/env bash | |
upload_max_filesize=240M | |
post_max_size=50M | |
max_execution_time=100 | |
max_input_time=223 | |
for key in upload_max_filesize post_max_size max_execution_time max_input_time | |
do | |
sed -i "s/^\($key\).*/\1 $(eval echo \${$key})/" php.ini |
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 paginate($a,$b=1,$c=5){$d=(($b*$c)-$c)+1;$e=$b*$c; | |
$f=1;$g=array();foreach($a as $h){if($f>=$d&&$f<=$e){$g[]=$h;}$f++;} | |
$i=ceil(count($a)/$c);return array('page_data'=>$g,'pages'=>$i,'page'=>$b);} | |
$data = array(1,2,3,4,5,6,7,8,9,10,11,12,13); | |
//get page 2 data, 4 items per-page | |
$page_info = paginate($data,2,4); | |
print_r($page_info); |
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 | |
$saved = getenv("LD_LIBRARY_PATH"); // save old value | |
$newld = "/extra/library/dir:/another/path/to/lib"; // extra paths to add | |
if ($saved) { $newld .= ":$saved"; } // append old paths if any | |
putenv("LD_LIBRARY_PATH=$newld"); // set new value | |
system("mycommand -with args"); // do system command; | |
// mycommand is loaded using | |
// libs in the new path list | |
putenv("LD_LIBRARY_PATH=$saved"); // restore old value | |
?> |
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 | |
//https://css-tricks.com/css-variables-with-php/ | |
?> |
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
<!-- http://www.weberdev.com/get_example.php3?ExampleID=3766 --> | |
<html> | |
<head> | |
<title>Untitled Document</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> | |
</head> | |
<body> | |
<form name="form1" method="post" action="newuser.php"> | |
<p>Login: | |
<input name="login" type="text" id="login"> |
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
<form> | |
<input name="pretrazi" method="get" type="search" class="" placeholder=" Search... " autofocus> | |
<input type="submit" value="ENTER" class="button"> | |
</form> | |
<?php | |
$pretrazi = $_GET['pretrazi']; | |
$sta_pretrazujemo = 'antistereotip apache c cherokee commandlinefu css3 debian fewona filmovionline fsf gaddafi gnu gwan hightech html5 irc kgb libre linog linux linuxzasve lisp ludus mongodb mysql nemysis neo4j ng1np nginx nginz oklop php popivoda postgresql profi python routefor sceko slackware-srbija sql unix videoteka webserveri wideip zaneupucene zdroid zdroidblog zpop'; | |
$rezultat = eregi($pretrazi,$sta_pretrazujemo); | |
if ($rezultat){ echo 'True, <b style="color:green">'.$pretrazi.'</b> je pronadjen!'; } |
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> | |
<head> | |
<script> | |
function myFunction(e) | |
{ | |
x=e.clientX; | |
y=e.clientY; | |
coor="Coordinates: (" + x + "," + y + ")"; | |
document.getElementById("demo").innerHTML=coor |
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
# nano /etc/vsftpd.conf | |
listen=NO | |
listen_ipv6=YES | |
anonymous_enable=NO | |
local_enable=YES | |
write_enable=YES | |
# local_umask=022 | |
# anon_upload_enable=YES | |
# anon_mkdir_write_enable=YES | |
dirmessage_enable=YES |
OlderNewer