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 :: wp create user programmatically 
Php :: get extension from filename php 
Php :: datetime php 
Php :: laravel model limit 
Php :: upload webp to wordpress 
Php :: laravel scheduler every 2 hours 
Php :: how to delete all products woocommerce in phpmyadmin 
Php :: get woocommerce order details 
Php :: how to get local current time in laravel 
Php :: get single column value in laravel eloquent 
Php :: php serialize array 
Php :: laravel how to ignore fields case insensitive 
Php :: php money_format currency symbol 
Php :: phpcs 
Php :: carbon laravel d m y to y-m-d 
Php :: Flutter Error - Migrate to android studio - MAC OS 
Php :: updating-product stock quantity programmatically woocommerce 
Php :: time php 
Php :: laravel group route controller 
Php :: laravel remove foreign key 
Php :: concat in where clause laravel query builder 
Php :: laravel try catch example 
Php :: laravel drop table column 
Php :: send email template via php 
Php :: vscode open php tag autocomplete 
Php :: laravel image validate 
Php :: php flatten multidimensional array 
Php :: php import script 
Php :: Sending Data over another website via laravel 
Php :: php utc time 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =