Define BASE tag in html using php
I want to define the BASE tag in html using PHP <!DOCTYPE html> <html lang="<?php echo LANG; ?>"> <head> <meta charset="<?php echo CHARSET; ?>"> <base href="<?php echo BASE; ?>"> </head> .... Did some research here, and came up with this. config.inc.php define('LANG', 'es_ES'); define('CHARSET', 'utf-8'); define('SERVER_SERVER_NAME', 'http://' . $_SERVER['SERVER_NAME']); define('SERVER_PHP_SELF', dirname($_SERVER['PHP_SELF'])); define('BASE', SERVER_SERVER_NAME . SERVER_PHP_SELF . '/'); 2 questions: Is there a way to define the keyword http? Sometimes it can be https and hardcoding that keyword is a bad idea. Should i define the BASE value by ending it with a slash or not ? Any improvements on this very simple code? Thanks
Just leave the protocol out, and start the URL with //. It will then default to the protocol of the document that contains it. The <base> URL should end with a / if you want it to specify a folder.
laravel schedule command missing
Merge the values of two or more arrays in php
Ajax send form values for executing credit card function validation
Replace some pattern with string
Differentiation Choices in Multiple choice with Multiple Answer Using PHP
Set cookie in Php Zend framework
Show data from dropbox to an input form
android php and server data storing and acccessing it and my php page website should work as web page for admin?
disable Wordpress Short Links
Mad hatter full calendar color events Laravel 5.4
Where should I use 'use' in php?
PHP mail corrupted attachment
How to combine 3 MySQL table inserts
MODAL HELP - how to pull row data per user id w/ PHP
How to create a file in resource/view directory Laravel
how can I show item that matches barcode number from table?