Categories
Handy Stuff

php sql echo textarea with line breaks

echo Text Area with line breaks

eg:

<?PHP echo nl2br($row['Description']); ?>

or

<?php echo nl2br($Description); ?>

Categories
news

Start Webmail

netstat -tupln | grep 2096

Categories
Uncategorized

Sunflower

Categories
news

Dynamic Radio Buttons

When you want to echo with php a selection using Radio Buttons

<fieldset data-role="controlgroup" class="float-md-right" data-type="horizontal">
    <legend align="right"><strong style="font-size:1.1rem;"><?php echo $JobProgress; ?></strong></legend>
    <input <?php if ($JobProgress == 'BOOKED IN') echo 'checked="checked"'; ?> type="radio" name="JobProgress" value="BOOKED IN" />
    <label for="BookedIn">BOOKED IN</label>
  <input <?php if ($JobProgress == 'TO DO') echo 'checked="checked"'; ?> type="radio" name="JobProgress" value="TO DO" />
    <label for="Proofing">TO DO</label>
    <input <?php if ($JobProgress == 'OUT ON PROOF') echo 'checked="checked"'; ?> type="radio" name="JobProgress" value="OUT ON PROOF" />
    <label for="Approved">OUT ON PROOF</label>
    <input <?php if ($JobProgress == 'APPROVED') echo 'checked="checked"'; ?> type="radio" name="JobProgress" value="APPROVED" />
        <label for="Finishing">APPROVED</label>
    <input <?php if ($JobProgress == 'FINISHING') echo 'checked="checked"'; ?> type="radio" name="JobProgress" value="FINISHING" />
    <label for="Approved">FINISHING</label>
    <input <?php if ($JobProgress == 'DISPATCHED') echo 'checked="checked"'; ?> type="radio" name="JobProgress" value="DISPATCHED" />
    <label for="Approved">DISPATCHED</label>
  </fieldset>

Categories
news

FileZilla 3.6.8 MacOS

If your looking for a FTP Client for MacOS 10.6.8
Download from Here : FileZilla for MacOS 10.6.8

MacOS 10.5 and up

Categories
news

Disable Cron for WordPress

Disable Cron – Add to the very top of wp-config.php

define('DISABLE_WP_CRON', true);

Add Cron to cPanel

cd /home/domain/public_html; /usr/local/bin/php -q wp-cron.php

Disable XML-RPC

Disable XML-RPC

 

Categories
news Uncategorized

.htaccess Strict-Transport-Security

Here are a few things we like to implement as a standard.


RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
ErrorDocument 401 /401.shtml
ErrorDocument 404 /404.shtml
ErrorDocument 500 /500.shtml
Options -Indexes
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
Header set X-Content-Type-Options nosniff
Header set X-XSS-Protection "1; mode=block"
Header set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
</IfModule>

Categories
news Uncategorized

ModSecurity

Manage mod_security via:

https://www.configserver.com/cp/cmc.html

additional information:

how-to-log-errors-and-warnings-into-a-file

block-php-file-access-using-mod-sec

disable-mod-security-for-a-bridge-php-script

https://github.com/SpiderLabs/ModSecurity/

Categories
news Uncategorized

The Zend OPcache

php scripts not updating?  FTP a new php file and it doesn’t update for the browser?

The issue could be the OPcache enabled on the server.

In my case I have changed the frequency that it checks for updated files.

Some good examples here:

https://www.scalingphpbook.com/blog/2014/02/14/best-zend-opcache-settings.html

https://tideways.com/profiler/blog/fine-tune-your-opcache-configuration-to-avoid-caching-suprises

How to Enable OPcache in cPanel

Categories
news Uncategorized

How do I add SRV records for Office 365?

https://help.one.com/hc/en-us/articles/115005596025-How-do-I-add-SRV-records-for-Office-365-