php_tricks
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
php_tricks [2016/07/20 16:57] – juckins | php_tricks [2018/11/01 21:32] (current) – juckins | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ==== PHP Tips ==== | ||
+ | |||
+ | Code tips: | ||
+ | |||
< | < | ||
$actual_link = ' | $actual_link = ' | ||
- | |||
echo "Our URL: $actual_link< | echo "Our URL: $actual_link< | ||
- | # the entire URL of the current page, including query string | + | # the entire URL of the current page, including query string |
$url = $_SERVER[' | $url = $_SERVER[' | ||
- | |||
echo " | echo " | ||
# the base URL of the current page without query string | # the base URL of the current page without query string | ||
- | |||
$url_base = $_SERVER[' | $url_base = $_SERVER[' | ||
- | |||
echo " | echo " | ||
# The web host | # The web host | ||
- | |||
$host = $_SERVER[' | $host = $_SERVER[' | ||
- | |||
echo " | echo " | ||
# Just the path of the URL without the filename | # Just the path of the URL without the filename | ||
- | |||
$path = substr($_SERVER[' | $path = substr($_SERVER[' | ||
- | |||
echo "Path of the URL without the filename ---> $path< | echo "Path of the URL without the filename ---> $path< | ||
</ | </ | ||
Line 31: | Line 26: | ||
More info on parsing the URL: http:// | More info on parsing the URL: http:// | ||
+ | Showing errors: | ||
+ | < | ||
+ | <?php | ||
+ | ini_set(' | ||
+ | ini_set(' | ||
+ | error_reporting(E_ALL); | ||
+ | ?> | ||
+ | |||
+ | test | ||
+ | |||
+ | <?php | ||
+ | echo " | ||
+ | $file=fopen(" | ||
+ | ?> | ||
+ | </ |
php_tricks.1469048256.txt.gz · Last modified: 2016/07/20 16:57 by juckins