snipt

Ctrl+h for KB shortcuts

Text only

PHP show errors

ini_set('error_reporting', E_ALL);
https://snipt.net/embed/02e786ea58bc9677b2518c6307f58945/
/raw/02e786ea58bc9677b2518c6307f58945/
02e786ea58bc9677b2518c6307f58945
text
Text only
1
2019-08-17T08:33:42
True
False
False
Feb 25, 2014 at 04:34 AM
/api/public/snipt/116541/
php-show-errors
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>ini_set(&#39;error_reporting&#39;, E_ALL); </span></pre></div> </td></tr></table>
apache, php

Text only

Increment php upload file size (add in htaccess)

php_value post_max_size 30M
php_value upload_max_filesize 30M
https://snipt.net/embed/23b1348ea164525fe04eb511ff37121d/
/raw/23b1348ea164525fe04eb511ff37121d/
23b1348ea164525fe04eb511ff37121d
text
Text only
2
2016-12-24T10:14:27
True
False
True
Jan 11, 2014 at 01:42 PM
/api/public/snipt/105048/
increment-php-upload-file-size-add-in-htaccess
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>php_value post_max_size 30M </span><span id="L-2"><a name="L-2"></a>php_value upload_max_filesize 30M </span></pre></div> </td></tr></table>
htaccess, php, wordpress

Text only

Show current year in php

<?php echo date("Y")?>
https://snipt.net/embed/766fe8a613da35ef37bf28312bb7021c/
/raw/766fe8a613da35ef37bf28312bb7021c/
766fe8a613da35ef37bf28312bb7021c
text
Text only
1
2019-08-14T07:37:47
True
False
False
Sep 13, 2012 at 05:58 AM
/api/public/snipt/47127/
show-current-year-in-php
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>&lt;?php echo date(&quot;Y&quot;)?&gt; </span></pre></div> </td></tr></table>
date, php, year

PHP

PHP redirect

<? header("location: http://www.yoursite.net"); ?>
https://snipt.net/embed/34a1d41ba3e2a752313a71c99b9e09e6/
/raw/34a1d41ba3e2a752313a71c99b9e09e6/
34a1d41ba3e2a752313a71c99b9e09e6
php
PHP
1
2016-12-13T19:46:01
True
False
True
Nov 16, 2012 at 06:34 AM
/api/public/snipt/42632/
redirect-in-php
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?</span> <span class="nb">header</span><span class="p">(</span><span class="s2">&quot;location: http://www.yoursite.net&quot;</span><span class="p">);</span> <span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
php