# gd-security-headers/1.2/forms/headers.php

GD Security Headers, version 1.2. 101 lines.

- Page: https://pluginprobe.com/plugins/gd-security-headers/1.2/code/forms/headers.php
- Raw: https://pluginprobe.com/plugins/gd-security-headers/1.2/raw/forms/headers.php
- Modified: 2019-05-11T09:30:58+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/gd-security-headers/1.2/code/forms/headers.php#L10-L20`.

```php
<?php

if (!defined('ABSPATH')) { exit; }

include(GDSIH_PATH.'forms/shared/top.php');

$list = gdsih()->build_headers_to_array();

?>

<div class="d4p-content-left">
    <div class="d4p-panel-scroller d4p-scroll-active">
        <div class="d4p-panel-title">
            <i aria-hidden="true" class="fa fa-code"></i>
            <h3><?php _e("Headers", "gd-security-headers"); ?></h3>
        </div>
        <div class="d4p-panel-info">
            <?php _e("All HTTP headers generated so they can be copied into server side config. Headers are generated based on the plugin settings.", "gd-security-headers") ?>
            <br/><br/><strong><?php _e("If you are not sure how to do that, please consult with your website hosting company support.", "gd-security-headers") ?></strong>
        </div>
        <div class="d4p-return-to-top">
            <a href="#wpwrap"><?php _e("Return to top", "gd-security-headers"); ?></a>
        </div>
    </div>
</div>
<div class="d4p-content-right">
    <div class="d4p-group d4p-group-extra d4p-group-important">
        <h3><?php _e("Apache Server", "gd-security-headers"); ?></h3>
        <div class="d4p-group-inner">
            <p><?php _e("If you use Apache server, this plugin can add headers automatically into HTACCESS file. But, if you have disabled HTACCESS or you prefer using global server config, you can copy rules from here.", "gd-security-headers"); ?></p>
            <div class="gdsih-code-block">
                <pre>&lt;IfModule mod_headers.c><br/><?php

                $first = true;
                foreach ($list as $key => $value) {
                    if (!$first) {
                        echo '<br/>';
                    }

                    echo '  # '.$key.'<br/>';
                    echo '  Header set '.$value.'<br/>';

                    $first = false;
                }

                ?>&lt;/IfModule></pre>
            </div>
        </div>
    </div>

    <div class="d4p-group d4p-group-extra d4p-group-important">
        <h3><?php _e("Nginx Server", "gd-security-headers"); ?></h3>
        <div class="d4p-group-inner">
            <p><?php _e("If you use NGINX server, you can copy rules from here to add to the server 'conf' file.", "gd-security-headers"); ?></p>
            <div class="gdsih-code-block">
                <pre><?php

                $first = true;
                foreach ($list as $key => $value) {
                    if (!$first) {
                        echo '<br/>';
                    }

                    echo '# '.$key.'<br/>';
                    echo 'add_header '.$value.';<br/>';

                    $first = false;
                }

                    ?></pre>
            </div>
        </div>
    </div>

    <div class="d4p-group d4p-group-extra d4p-group-important">
        <h3><?php _e("IIS Server", "gd-security-headers"); ?></h3>
        <div class="d4p-group-inner">
            <p><?php _e("If you use IIS server, you can copy rules from here to add to the server 'Web.config' file.", "gd-security-headers"); ?></p>
            <div class="gdsih-code-block">
                <pre>&lt;system.webServer>
  &lt;httpProtocol>
    &lt;customHeaders><br/><?php

                    foreach ($list as $key => $value) {
                        $parts = explode(' ', $value, 2);

                        echo '      &lt;add name="'.$parts[0].'" value='.$parts[1].' /><br/>';
                    }

                    ?>    &lt;/customHeaders>
  &lt;httpProtocol>
&lt;system.webServer></pre>
            </div>
        </div>
    </div>
</div>

<?php

include(GDSIH_PATH.'forms/shared/bottom.php');

```
