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 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 :: laravel artisan cache clear 
Php :: php full day name 
Php :: time in php 
Php :: redirect back with input laravel in request 
Php :: phpspreadsheet middle align 
Php :: laravel http retry 
Php :: laravel count group by date 
Php :: convert multidimensional array to single array php 
Php :: define("ROOT PATH", __DIR__); 
Php :: multidimensional array item remove php 
Php :: laravel datatable format date column 
Php :: Laravel Password & Password_Confirmation Validation 
Php :: php string contains 
Php :: wordpress max post revision 
Php :: How to request and display data from db in larave 
Php :: Flutter migrate to Android Studio 
Php :: percentage in php 
Php :: how to send ajax request in laravel 
Php :: php check connection to database 
Php :: PHP money_format — Formats a number as a currency string 
Php :: how to get current location in laravel 
Php :: Exception::getMessage in php 
Php :: run shell script from php file 
Php :: get parameter php 
Php :: delete bunch of rows in laravel 
Php :: symfony doctrine existing database 
Php :: laravel redirect to intended page after register 
Php :: array_fill php 
Php :: how to send data from one website to another in php 
Php :: PHP OOP - Classes and Objects 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =