问题
I'm trying to redirect the user's click on a link to a telephone number through php like this:
//HTML
<a href="tele.php">
and the php:
<?php
header("Location: tel:+123456789");
exit;
?>
This works on newer mobile browsers but won't on the older ones in particular Nokia WAP2.0 browser. Any ideas, plaese?
回答1:
Try wtai://wp/mc;xxxxxxxxx
instead of tel:
.
回答2:
I've found a solution after few trials.
I set up a third-level domain of my main domain: call.mydomain.it
.
In its docroot I placed an index.php
file containing these lines:
<?php
if(isset($_GET['tel']) && $_GET['tel'] != "")
{
$tel = $_GET['tel'];
header("Location: tel://$tel");
}
die();
?>
So, when I load call.mydomain.it/?tel=00393331234567
the browser starts a call to the number passed as argument.
Further on, if you have to setup a web marketing campaign, you can shrink this url with this free tool
Hope having helped you
来源:https://stackoverflow.com/questions/11293349/php-redirect-header-location-to-phone-number