Is there anyway to pass values from ASP.NET to PHP easily using Session or any other? 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.
ASP.NET code.
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
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.
Response.Redirect("Default.php?myparam=myvalue");
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.