PHP Get Current URL Full Path HTTP-HTTPS Protocol

PHP Get Current URL Full Path HTTP-HTTPS Protocol

In this Post We Will Explain About is PHP Get Current URL Full Path HTTP-HTTPS Protocol With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to php get http or https from urlExample

In this post we will show you Best way to implement PHP Get Site URL Protocol HTTP or HTTPS, hear for php – Identify whether the current url is http or https in a projectwith Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

php check if url contains http or https using PHP

<?php
	$set_domain_name =  $get_current_protocol = $get_current_domain = "";
	$get_current_protocol = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || 
    $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
    $get_current_domain = $_SERVER['HTTP_HOST'];
    $set_domain_name = $get_current_protocol.$get_current_domain;
	var_dump(set_domain_name);
	
	
    $base_image_url = $set_domain_name."/admin/upload/images/";
	var_dump(base_image_url);
	
	
	$temp = explode(".", $_FILES["upload"]["name"]);
	$newfilename = date("Ymd").round(microtime(true)) . '.' . end($temp);
	move_uploaded_file($_FILES["upload"]["tmp_name"],"images/".$newfilename);
	$image_url = $base_image_url . $newfilename;
	
	echo "
Simple Stored in: " . $image_url; ?>

PHP Simple Get Site URL Protocol – “HTTP or HTTPS”

using PHP Simple Check to your current url is http any type of Protocol and get to PHP if condition check.


How to get current page URL in PHP

Simple Answer: Use the simple PHP $_SERVER use the Superglobal Variable

    

Example

I hope you have Got What is How To Check URL Protocol Is https by PHP And how it works.I would Like to have FeadBack From My Blog(Pakainfo.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(Pakainfo.com) Are Most Always Welcome.

Leave a Comment