Code Sharing Repository Public source code sharing repository http://devcodepro.com Highlight String Example - Code Sharing Repository '; echo ' '; highlight_string($string); echo ' '; ?> http://devcodepro.com/view/75/62/Highlight-String-Example http://devcodepro.com/view/75/62/Highlight-String-Example Sun, 20 Jan 2019 20:37:34 GMT Sending HTML Email With Image - Code Sharing Repository Email With Image Sending HTML Email With Image ' . $message . ' '; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n"; $headers .= 'From:... http://devcodepro.com/view/74/62/Sending-HTML-Email-With-Image http://devcodepro.com/view/74/62/Sending-HTML-Email-With-Image Sun, 20 Jan 2019 19:48:04 GMT Display and log errors - Code Sharing Repository error_reporting(E_ALL); ini_set('display_errors', TRUE); ini_set('log_errors', TRUE); ini_set('error_log', 'php.log'); http://devcodepro.com/view/73/1/Display-and-log-errors http://devcodepro.com/view/73/1/Display-and-log-errors Sat, 8 Dec 2018 17:48:50 GMT Block googlebot robots.txt - Code Sharing Repository User-agent: Googlebot Disallow: / http://devcodepro.com/view/72/1/Block-googlebot-robots-txt http://devcodepro.com/view/72/1/Block-googlebot-robots-txt Wed, 28 Nov 2018 00:01:26 GMT htaccess redirect http to https - Code Sharing Repository RewriteEngine On RewriteCond %{HTTPS} off RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] http://devcodepro.com/view/71/62/htaccess-redirect-http-to-https http://devcodepro.com/view/71/62/htaccess-redirect-http-to-https Sat, 23 Jun 2018 11:07:37 GMT ADOdb - Check if MySQL query executed successfully - Code Sharing Repository Prepare('DELETE FROM mytable WHERE id = ' . $DB->qstr($id) . ''); if ($DB->Execute($sql) === false) { print $DB->ErrorMsg(); } if ($DB->affected_rows() !== 0) { //true } ?> http://devcodepro.com/view/70/1/ADOdb-Check-if-MySQL-query-executed-successfully http://devcodepro.com/view/70/1/ADOdb-Check-if-MySQL-query-executed-successfully Tue, 29 May 2018 16:20:25 GMT Article Structured data Schema Markup - Code Sharing Repository My Article Name My Description Name Website Articles 4 out of 5 stars based on 1 votes http://devcodepro.com/view/69/62/Article-Structured-data-Schema-Markup http://devcodepro.com/view/69/62/Article-Structured-data-Schema-Markup Mon, 21 May 2018 04:27:10 GMT Bootstrap 4 change input placeholder color - Code Sharing Repository .form-control::-webkit-input-placeholder { color: #bbb; } http://devcodepro.com/view/68/8/Bootstrap-4-change-input-placeholder-color http://devcodepro.com/view/68/8/Bootstrap-4-change-input-placeholder-color Sun, 13 May 2018 15:51:24 GMT Change arrow size and colors in Bootstraps carousel - Code Sharing Repository .carousel-control-prev-icon { background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23f8f8f8' viewBox='0 0 8 8'%3E%3Cpath d='M5.25 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3E%3C/svg%3E"); }... http://devcodepro.com/view/67/8/Change-arrow-size-and-colors-in-Bootstraps-carousel http://devcodepro.com/view/67/8/Change-arrow-size-and-colors-in-Bootstraps-carousel Tue, 24 Apr 2018 14:27:31 GMT ADOdb count number of records - Code Sharing Repository $recordSet = $conn->Execute('SELECT * FROM mytable where published = '.$conn->qstr('1').' or published = '.$conn->qstr('2').' order by id DESC'); $counter = $recordSet->recordCount(); echo $counter; http://devcodepro.com/view/66/1/ADOdb-count-number-of-records http://devcodepro.com/view/66/1/ADOdb-count-number-of-records Sun, 8 Apr 2018 04:14:33 GMT Exim - How to block certain domain - Code Sharing Repository 1. In etc/exim/exim.conf after this line: # $Cambridge: exim/exim-src/src/configure.default,v 1.14 2009/10/16 07:46:13 tom Exp $ put this line: system_filter = /etc/exim/filters 2. Create file filters in /etc/exim/ folder with code: if $header_from: contains... http://devcodepro.com/view/65/7/Exim-How-to-block-certain-domain http://devcodepro.com/view/65/7/Exim-How-to-block-certain-domain Wed, 28 Feb 2018 11:02:34 GMT SSH IPTables command to block IP Address - Code Sharing Repository [my@server ~]# iptables -A INPUT -s x.xx.xx.xx -p tcp --dport 25 -j REJECT [my@server ~]# service iptables save [my@server ~]# service iptables restart http://devcodepro.com/view/64/7/SSH-IPTables-command-to-block-IP-Address http://devcodepro.com/view/64/7/SSH-IPTables-command-to-block-IP-Address Tue, 27 Feb 2018 09:41:12 GMT Warning: purging the environment. Suggested action: use keep_environment issue - Code Sharing Repository 1. Open etc/exim/exim.conf 2. Directly after this code line: # $Cambridge: exim/exim-src/src/configure.default,v 1.14 2009/10/16 07:46:13 tom Exp $ add: keep_environment = X-SOURCE : X-SOURCE-ARGS : X-SOURCE-DIR add_environment =... http://devcodepro.com/view/63/7/Warning-purging-the-environment-Suggested-action-use-keep_environment-issue http://devcodepro.com/view/63/7/Warning-purging-the-environment-Suggested-action-use-keep_environment-issue Tue, 27 Feb 2018 09:25:15 GMT htaccess redirect www to non-www - Code Sharing Repository RewriteEngine On RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L] http://devcodepro.com/view/62/14/htaccess-redirect-www-to-non-www http://devcodepro.com/view/62/14/htaccess-redirect-www-to-non-www Mon, 19 Feb 2018 23:28:09 GMT Smarty XML / RSS example file - Code Sharing Repository Site Name Site Description http://www.example.com {section name=foo loop=$foo} {$foo[foo].progname|stripslashes|replace:"'":''|replace:'"':''|escape:'htmlall':'UTF-8'|replace:'&':'... http://devcodepro.com/view/61/14/Smarty-XML-RSS-example-file http://devcodepro.com/view/61/14/Smarty-XML-RSS-example-file Fri, 9 Feb 2018 06:41:38 GMT Full text search order by relevance - Code Sharing Repository SELECT SQL_CALC_FOUND_ROWS *, MATCH (title,description) AGAINST ('Text') as score FROM posts WHERE MATCH (title,description) AGAINST ('Text') ORDER by score DESC; http://devcodepro.com/view/60/1/Full-text-search-order-by-relevance http://devcodepro.com/view/60/1/Full-text-search-order-by-relevance Wed, 13 Dec 2017 05:18:51 GMT Image in Textarea - Code Sharing Repository #textarea { border:#eee solid 1px; background:#fff url(images/myimage.png) no-repeat left 10px top 8px; } /* */ http://devcodepro.com/view/59/14/Image-in-Textarea http://devcodepro.com/view/59/14/Image-in-Textarea Thu, 7 Dec 2017 02:24:01 GMT How to get clean file / image name with extension from the URL in PHP? - Code Sharing Repository $reg = '/(?<=jpg|png|gif|jpeg).*/'; $url = 'https://example.com/2012/12/zoe.jpg?w=600&#038;h=400&#038;crop=1,"; "=""'; $rep = ''; $result = preg_replace($reg, $rep, $url); $cleanfile = basename($result); echo $cleanfile; http://devcodepro.com/view/58/14/How-to-get-clean-file-image-name-with-extension-from-the-URL-in-PHP- http://devcodepro.com/view/58/14/How-to-get-clean-file-image-name-with-extension-from-the-URL-in-PHP- Mon, 4 Dec 2017 17:57:17 GMT Search MySQL utf8 and latin1 - Code Sharing Repository SELECT * FROM tablename WHERE MATCH (name,description) AGAINST ('phrase' IN BOOLEAN MODE) or convert(cast(convert(name using latin1) as binary) using utf8) = 'phrase' or convert(cast(convert(description using latin1) as binary) using utf8) = 'phrase'; SELECT *... http://devcodepro.com/view/57/1/Search-MySQL-utf8-and-latin1 http://devcodepro.com/view/57/1/Search-MySQL-utf8-and-latin1 Thu, 16 Nov 2017 19:47:54 GMT Avoid spam points - Message only has text/html MIME parts - Code Sharing Repository "."\r\n"; $header .= "Organization: My Company Name \r\n"; $header .= "Content-Type: multipart/alternative;boundary=" . $uid . "\r\n"; $body = "This is a MIME encoded message."; $body .= "\r\n\r\n--" . $uid . "\r\n";... http://devcodepro.com/view/56/1/Avoid-spam-points-Message-only-has-text-html-MIME-parts http://devcodepro.com/view/56/1/Avoid-spam-points-Message-only-has-text-html-MIME-parts Tue, 14 Nov 2017 04:52:05 GMT