大家好,我有以下代码从我的网站分享到whatsapp网站的链接:
https://web.whatsapp.com/send?text=http://www.myapp.com/goto.php?e=321AAA
但是当我点击链接或按钮时,不会仅仅共享整个文本:
“http://www.myapp.com/goto.php?e”
但没有= 321AAA
已经尝试过Jquery。
$('#w2').click(function() {
var str1= "https://web.whatsapp.com/send?text=http://www.myapp.com/goto.php?e=";
var str3=str1.concat("<?php echo $_SESSION['linkEv'] . $_SESSION['PIN']; ?>");
window.location =str3;
console.log(str3);
});
在某种程度上,链接不处理我认为的“=”字符。
答案 0 :(得分:0)
以下为我工作......
<?php
session_start();
$_SESSION['PIN'] = 6543;
$_SESSION['linkEv'] = 'FooBar';
?>
<script>
var url = 'https://web.whatsapp.com/send?text=https://example.com?param=';
var pin = "<?php echo $_SESSION['linkEv'] . $_SESSION['PIN']; ?>";
var combination = url.concat( pin );
window.location = combination;
</script>