How to send request request to ITMS URL in PHP?

I have the following code that does not work. ITMS does not invoke a get request URL.

header('Location: itms-services://?action=download-manifest&url=http://www.mysite.com/plistReader.php?id=123');

If I delete id=123, it will start working. But I need to send this to keep the dynamic id. In the session I also can’t get through. Please, help.

+3
source share
2 answers

You need to url this question mark as %3F, since it is a reserved character. As @wroniasty pointed out, you also need to encode =how %3D.

header('Location: itms-services://?action=download-manifest&url=http://www.mysite.com/plistReader.php%3Fid%3D123');

See also: http://www.blooberry.com/indexdot/html/topics/urlencoding.htm

+5
source

URL- . PHP 5 - urlencode(), http_build_query() - . , / GET , , .

<?php
    $base_url = "http://www.mysite.com/plistReader.php";
    $data = Array("id" => 123, "dangerous" => ":?&= are some sensitive chars");

    $itms_url = "itms-services://?action=download-manifest&url=" . urlencode($base_url . "?" . http_build_query($data));
    header('Location: ' . $itms_url);
?>
0

All Articles