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 get url 
Php :: convert array to string laravel 
Php :: date and time in php 
Php :: laravel check my laravel version 
Php :: use ternary operator as null coalescing operator in php 
Php :: php start of day epoch 
Php :: laravel in array blade 
Php :: php find part of string in array 
Php :: php read csv to array 
Php :: deactivate auto update wordpress plugins 
Php :: convert image to base64 in laravel 
Php :: laravel validator make custom message 
Php :: php declare strict_types 
Php :: get value from json laravel 
Php :: mysqli last index php 
Php :: laravel websockets onsubscribe 
Php :: symfony redirect to previous page 
Php :: php list all constants 
Php :: populate old value of dropdown laravel 
Php :: laravel use session values in view 
Php :: php random number generator 
Php :: php use variable as object key 
Php :: php get day number 
Php :: get id php 
Php :: laravel collection transform 
Php :: how to prompt user for input in php 
Php :: order by in datatable laravel 
Php :: if i am using $_SERVER it shows 500 error 
Php :: curl in laravel 
Php :: array_diff 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =