Search
 
SCRIPT & CODE EXAMPLE
 

PHP

get url php

$url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
Comment

get url with php

$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
Comment

get url link in php

actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
Comment

php current url

 $currentUrl = $_SERVER['REQUEST_URI'];
Comment

php get current page url

<?php echo 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>
Comment

php current url

function url_origin( $s, $use_forwarded_host = false )
{
    $ssl      = ( ! empty( $s['HTTPS'] ) && $s['HTTPS'] == 'on' );
    $sp       = strtolower( $s['SERVER_PROTOCOL'] );
    $protocol = substr( $sp, 0, strpos( $sp, '/' ) ) . ( ( $ssl ) ? 's' : '' );
    $port     = $s['SERVER_PORT'];
    $port     = ( ( ! $ssl && $port=='80' ) || ( $ssl && $port=='443' ) ) ? '' : ':'.$port;
    $host     = ( $use_forwarded_host && isset( $s['HTTP_X_FORWARDED_HOST'] ) ) ? $s['HTTP_X_FORWARDED_HOST'] : ( isset( $s['HTTP_HOST'] ) ? $s['HTTP_HOST'] : null );
    $host     = isset( $host ) ? $host : $s['SERVER_NAME'] . $port;
    return $protocol . '://' . $host;
}

function full_url( $s, $use_forwarded_host = false )
{
    return url_origin( $s, $use_forwarded_host ) . $s['REQUEST_URI'];
}

$absolute_url = full_url( $_SERVER );
echo $absolute_url;
Comment

PREVIOUS NEXT
Code Example
Php :: php number precision 
Php :: public laravel htaccess 
Php :: string to double php 
Php :: flutter boxdecoration add border 
Php :: change php max upload size 
Php :: twig jsoncencode 
Php :: how to use bootstrap in laravel 8 remove tailwind 
Php :: with in relation laravel 
Php :: in random order laravel 
Php :: laravel password verification 
Php :: laravel updateorcreate 
Php :: remove storefront footer 
Php :: php get uploaded file extension 
Php :: wp get term link 
Php :: yii2 where in 
Php :: add zeros in front of number php 
Php :: how to split url in php 
Php :: php reload current page 
Php :: logout in laravel 
Php :: yii2 sql query 
Php :: intl extension php ubuntu 
Php :: wordpress define constant if not defined 
Php :: remove gutenberg styles 
Php :: how if charactor is exist in text in laravel 
Php :: php compare strings case insensitive 
Php :: mysql timestamp format php 
Php :: string to bool php 
Php :: Fetch Data From Database With MySQLI 
Php :: how make exception laravel if operation does not work 
Php :: php header base64 pdf 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =