php


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.

Related Links

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?

Categories

HOME
class
adfs3.0
braintree
initialization
specifications
stack-overflow
powermock
smartgwt
mailgun
bnf
tomcat8
libgit2
akka-persistence
chronicle-queue
quartz.net
firemonkey-style
managed-c++
window-managers
unrar
xdebug
sap-lumira
history.js
annotation-processing
iwebbrowser2
unmarshalling
copy-protection
credit-card
xenapp
matlab-app-designer
infopath2010
xcrun
plantuml
universal
advanced-filter
autoencoder
stackpanel
android-n
tidal-scheduler
system-on-chip
vb.net-to-c#
notesview
xcode8.2
audio-converter
md5-file
non-linear-regression
solr-query-syntax
embedded-v8
aurelia-fetch-client
google-news
dblink
case-when
front-camera
nrf51
always-on-top
msbuild-4.0
mathml
android-sdcard
simian
frame-grab
taco
flush
myfaces
ajax4jsf
smart-tv
apache-commons-digester
place
directx-9
enaml
netdatacontractserializer
uitest
org-babel
explain
textscan
com0com
mgwt
mxe
fat32
configurable-product
angular-ui-select
aho-corasick
otl
coding-efficiency
screwturn
bittorrent-sync
xulrunner
preorder
quickgraph
node.js-stream
unicoins
axacropdf
handshake
smartfox
opends
nsfont
mkannotation
background-repeat
snackjs
net-use
sql-parametrized-query
page-curl
suphp
aptitude
icicles
oracle-pro-c
source-code-protection
server-load
webclient.uploaddata

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App