php get full url
$fullURL = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
php get full url
$fullURL = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
php get url with get
$full_url = 'http://'.$_SERVER[HTTP_HOST].$_SERVER[REQUEST_URI];
how to get the link of the current page in php
<?php
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on')
$url = "https://";
else
$url = "http://";
// Append the host(domain name, ip) to the URL.
$url.= $_SERVER['HTTP_HOST'];
// Append the requested resource location to the URL
$url.= $_SERVER['REQUEST_URI'];
echo $url;
?>
php get
#Get Method and Post Data
Send data through get and Post
$_GET Example
============
<?php
if(isset($_GET['name'])){
echo htmlentities($_GET['name']);
//or
//$name = htmlentities($_GET['name']);
//echo $name
print_r($_GET);
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Get post website</title>
</head>
<body>
<form method="GET action=get_post.php">
<div>
<label>Name</label><br>
<input type="text" name ="name">
</div>
<div>
<label>Email</label><br>
<input type="text" name ="email">
</div>
<input type="submit" value ="Submit">
</form>
</body>
</html>
================
$_POST Example
================
<?php
if(isset($_GET['name'])){
//echo htmlentities($_GET['name']);
//or
//$name = htmlentities($_GET['name']);
//echo $name
//print_r($_GET);
}
if(isset($_POST['name'])){
$name = htmlentities($_POST['name']);
echo $name;
print_r($_POST);
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Get post website</title>
</head>
<body>
<form method="POST" action="get_post.php">
<div>
<label>Name</label><br>
<input type="text" name ="name">
</div>
<div>
<label>Email</label><br>
<input type="text" name ="email">
</div>
<input type="submit" value ="Submit">
</form>
</body>
</html>
================
$_REQUEST Example //another uncommon way to do it. This is not
//normally done this way
================
<?php
if(isset($_REQUEST['name'])){
$name = htmlentities($_REQUEST['name']);
echo $name;
print_r($_REQUEST);
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Get post website</title>
</head>
<body>
<form method="POST" action="get_post.php">
<div>
<label>Name</label><br>
<input type="text" name ="name">
</div>
<div>
<label>Email</label><br>
<input type="text" name ="email">
</div>
<input type="submit" value ="Submit">
</form>
</body>
</html>
================
$_SERVER['QUERY_STRING'] Example
================
<?php
echo $_SERVER['QUERY_STRING'];
?>
<!DOCTYPE html>
<html>
<head>
<title>Get post website</title>
</head>
<body>
<form method="POST" action="get_post.php">
<div>
<label>Name</label><br>
<input type="text" name ="name">
</div>
<div>
<label>Email</label><br>
<input type="text" name ="email">
</div>
<input type="submit" value ="Submit">
</form>
</body>
</html>
get url link in php
actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
php get url
$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us