• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

PHP header location absolute URL

php


PHP Snippet 1:

header("location:http://www.example.com/path/to/myfile.php");
exit;

PHP Snippet 2:

$url = $_SERVER["HTTP_HOST"]."/path/to/myfile.php";
header("location:".$url);
exit;

Related Snippets

Woocommerce Checkout - Add conditional field required if one field is filled

Can we define variables in `.tpl` files?

Wordpress 'post_type_link' hides permalink

Magento 2 - Controller returning blank page

Calculating Median of an array in PHP

Update Order custom Field value with WooCommerce REST API

GuzzleHttp Hangs When Using Localhost

Performance of foreach, array_map with lambda and array_map with static function

Show Custom Data in Woocommerce Order Details Admin Area

Star and Half Star Rating in Laravel

Select option menu read from database and use it's values

Convert every two values of an associative array into key-value pairs

Normalize DateInterval in PHP

Edit XML in HTML form and submit to self

How to use a PHP MVC Controller, one thats invoked by calling a URL, to call and execute more than one function? [duplicate]

About Contact Privacy policy Terms and conditions