通过php隐藏ios安装应用程序的下载链接


hide download link of ios install app by php

已解决。

我有一个链接,可以安装在safari中工作的ios应用程序。

<a href="itms-services://?action=download-manifest&url=https://acqshop.com/manifest/category/Farsi/ashpazi.plist"></a>

现在我想对用户隐藏链接。但我不知道该怎么做。我用onclick作为链接:

<a href="javascript:void(0);" onclick="javascript:install();" target="Farsi/ashpazi.plist"></a>
function install() {
if (!isMobile()) {
    alert('you can download from ios devices');
    return;
}
var post_link = $(this).attr("target");
url = 'install.php?name='+post_link;
window.location.href = url;
}

和安装中。hp:

<?php
$name = $_GET['name'];      
$path = 'itms-services://?action=download-manifest&url=https://acqshop.com/manifest/category/'.$name;
$mm_type="application/octet-stream"; 
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Type: " . $mm_type);
header("Content-Length: " .(string)(filesize($path)) );
header('Content-Disposition: attachment; filename="'.basename($path).'"');
header("Content-Transfer-Encoding: binary'n");
readfile($path); // outputs the content of the file
exit();
?>

但它不起作用。我怎么了
您可以在这个网站上看到onclick函数下载ios应用程序的示例:
ipa.othman.tv/ipa/vi2.php
但是我不明白installvi2.php中的函数是什么
(请参阅页面来源)
谢谢

感谢@Shynggys我将install.php更改为:

<?php
$name = $_GET['name'];      
$path = 'itms-services://?action=download-manifest&url=https://acqshop.com/manifest/category/'.$name;
$mm_type="application/octet-stream"; 
header("Pragma: public");
header("Expires: 0");
header('Location:' .$path); 
?>

尝试使用绝对URL,而不是相对URL,并从函数"install"返回"false",它应该看起来像这样:

function install() {
if (!isMobile()) {
    alert('you can download from ios devices');
    return;
}
var post_link = $(this).attr("target");
url = 'http://MyWebSite.kz/install.php?name='+post_link;
window.location.href = url;
return false;
}

希望它能帮助