echo htmlspecialchars('<script>...</script>', ENT_QUOTES);
// <script>...</script>
if($i>hexdec('ff')){ // $i > 0xFF
return false;
// Сюда никогда не попадём =(
// А тут ещё и undefined константа
$GLOBALS[xreservederror].='<t>[u01] Database is full.</t>';
break;
}
$xreserveddbstrings=1000;
примитивный скрипт БД для хранения ссылок
if(!file_exists('./db/'.$pre.dechex($listindex).'.list')){
// ...
}elseif(filesize('./db/'.$pre.dechex($listindex).'.list')<($liststring*($size+1))){
// ...
}else{
$listf=fopen('./db/'.$pre.dechex($listindex).'.list', 'r');
fseek($listf, ($liststring*($size+1)));
// ...
}
Насколько эффективно его использовать при общем объёме данных около 3 ГБ (xreservedmaxstrings будет больше)?
<?php $description = 'file_description'; ?>
<p class="fileDescription"<?php if (!strlen($description)) echo ' style="display: none"'; ?>>
Описание: <span><?php echo $description; ?></span>
</p>
<style>
.hidden {
display: none;
}
</style>
<?php $description = 'file_description'; ?>
<p class="fileDescription<?php if (!strlen($description)) echo ' hidden'; ?>">
Описание: <span><?php echo $description; ?></span>
</p>
.fileDescription:has(span:empty) {
display: none;
}
`curl https://sandbox.zamzar.com/v1/files/9364488/content ...`
SELECT * FROM `wp_posts`
WHERE `ID` IN(
3459, 3461, 3462, 3466, 3468, 3470,
3525, 3531, 3536, 3541, 3546, 3553,
3555, 3561, 3566, 3571, 3576, 3584,
3589, 3594, 3599, 3605, 3610
);
UPDATE `wp_posts`
SET `post_content` = REPLACE(`post_content`, 'search', 'replace')
WHERE `ID` IN(
3459, 3461, 3462, 3466, 3468, 3470,
3525, 3531, 3536, 3541, 3546, 3553,
3555, 3561, 3566, 3571, 3576, 3584,
3589, 3594, 3599, 3605, 3610
);
Я не могу придумать как хранить статистику посещаемости Хосты - Хиты.
С учётом что на счётчике нужно отрисовывать хосты за сегодня, вчера и за всё время
<?php
define('QUERY_TABLE_PREFIX', 'prefix_');
define('QUERY_TABLE_ENTITYES', 'entity');
define('QUERY_GET_ENTITY_BY_ID',
'SELECT `id` AS id, `name` AS name, `origin` AS domain, `token` AS token ' .
'FROM ' . QUERY_TABLE_PREFIX . QUERY_TABLE_ENTITYES . ' ' .
'WHERE `id`=?i LIMIT 1'
);
class Query
{
const TABLE_PREFIX = QUERY_TABLE_PREFIX;
const TABLE_ENTITYES = QUERY_TABLE_ENTITYES;
const GET_ENTITY_BY_ID = QUERY_GET_ENTITY_BY_ID;
}
$queryString = Query::GET_ENTITY_BY_ID;
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 month"
ExpiresByType text/cache-manifest "access plus 0 seconds"
<FilesMatch \.(html|xhtml|xml|shtml|phtml|php|txt)$>
ExpiresDefault "access plus 0 seconds"
</FilesMatch>
ExpiresByType text/html "access plus 0 seconds"
ExpiresByType text/xml "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType application/json "access plus 0 seconds"
ExpiresByType application/rss+xml "access plus 1 hour"
ExpiresByType application/atom+xml "access plus 1 hour"
<FilesMatch \.(ico)$>
ExpiresDefault "access plus 1 week"
</FilesMatch>
ExpiresByType image/x-icon "access plus 1 week"
<FilesMatch \.(gif|png|jpg|jpeg|ogg|mp4|mkv|flv|swf|wmv|asf|asx|wma|wax|wmx|wm)$>
ExpiresDefault "access plus 1 year"
</FilesMatch>
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType video/ogg "access plus 1 month"
ExpiresByType audio/ogg "access plus 1 month"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType video/webm "access plus 1 month"
ExpiresByType text/x-component "access plus 1 month"
<FilesMatch \.(eot|ttf|otf|svg|woff)$>
ExpiresDefault "access plus 1 year"
</FilesMatch>
ExpiresByType application/x-font-ttf "access plus 1 month"
ExpiresByType font/opentype "access plus 1 month"
ExpiresByType application/x-font-woff "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
<FilesMatch \.(css|js)$>
ExpiresDefault "access plus 1 year"
</FilesMatch>
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
</IfModule>