使用 Cookie 将值从 ASP.NET 传递到 PHP
我想将字符串从 ASP.NET 页面传输到 PHP 页面。我的朋友建议了以下代码,但它不起作用。谁能告诉我错误在哪里。
ASP.NET 代码
protected void Button1_Click(object sender, EventArgs e)
{
HttpCookie cookie = new HttpCookie("name");
cookie.Secure = true;
cookie.Value = "Joe";
Response.Redirect("sample.php");
}
PHP 代码
<?php
session_start();
var_dump($client->_cookies);
echo "cookie is ".$client->_cookies["name"][0];
?>
OR
<?php
session_start();
$_COOKIE['name'];
$cookies = getCookies();
$sessionId = $cookies['name'];
?>
。
除此之外还有什么办法可以将值从 ASP.NET 页面传递到 PHP 页面吗?
I wanna transfer strings from an ASP.NET page to a PHP page. The following code was suggested by my friend but its not working. Can anybody tell me where the error is at.
ASP.NET code
protected void Button1_Click(object sender, EventArgs e)
{
HttpCookie cookie = new HttpCookie("name");
cookie.Secure = true;
cookie.Value = "Joe";
Response.Redirect("sample.php");
}
PHP code
<?php
session_start();
var_dump($client->_cookies);
echo "cookie is ".$client->_cookies["name"][0];
?>
OR
<?php
session_start();
$_COOKIE['name'];
$cookies = getCookies();
$sessionId = $cookies['name'];
?>
.
Apart from this is there anyway to pass values from an ASP.NET page to PHP page?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论