[英]Passing values from ASP.NET to PHP
Is there anyway to pass values from ASP.NET to PHP easily using Session or any other? 无论如何,是否可以使用Session或其他任何方法将值从ASP.NET轻松传递给PHP? I tried in the below way but it didn't work for me.
我按以下方式尝试过,但对我不起作用。 Anybody either correct the below code or suggest me a way to pass values from ASP.NET to PHP without using URL query string.
任何人要么更正下面的代码,要么向我建议一种不使用URL查询字符串就将值从ASP.NET传递到PHP的方法。
ASP.NET code. ASP.NET代码。
protected void Button1_Click(object sender, EventArgs e)
{
HttpCookie cookie = new HttpCookie("myvalue1");
cookie.Value = "joe@example.com";
Response.Redirect("Default.php");
}
PHP code. PHP代码。
<?php
session_start();
$_COOKIE['myvalue1'];
$cookies = getCookies();
$sessionId = $cookies['myvalue1'];
?>
您可以在PHP端创建WSDL / REST API,只需将数据从.Net发送到此API
There are a few ways to do this, but none are particularly sexy. 有几种方法可以做到这一点,但是没有一种是特别性感的。
EDIT: You could even roll your own state server. 编辑:您甚至可以滚动自己的状态服务器。 Create a webservice that stores data from asp.net and php retrieves it when needed.
创建一个存储来自asp.net的数据的Web服务,然后php在需要时检索它。
Response.Redirect("Default.php?myparam=myvalue");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.