I want to send data from one PHP file to another PHP file in a subfolder where the first PHP file is present. I have a folder named folder1
which has contains a PHP file named file1.php
and I want to call another file named file2.php
in a subfolder of folder1
named folder2
. I am using the header()
function like this in file1.php
:
$host = $_SERVER['HTTP_HOST'];
$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
$extra = 'folder1/folder2/file2.php';
header("location:http://$host$uri/$extra?sms=".$msg."&num=".$msg_num);
Data is not passing. Is there any solution using header()
? I can't use cURL
because of some restrictions.