开发者

.net, c# post to php page

开发者 https://www.devze.com 2023-01-14 04:23 出处:网络
I have a website that is primarily PHP but we have built some new pages in c# .net.I need to be able to post (i think) to the PHP page.

I have a website that is primarily PHP but we have built some new pages in c# .net. I need to be able to post (i think) to the PHP page.

The PHP page has a login that takes the login name and password. I am trying to allow my .net page 开发者_如何学运维to have a login that directs to the PHP page and once there the user is already logged in.

I believe I can post the data to the PHP page... is that correct?

If so, can someone share a code snippet that points me in the right direction?

Thanks for the help!!


I believe there is a cURL version for c#, the easy way would be to set that up if you can. Some information on using cURL with .NET can be found here and there are a few other resources on Google for c# curl


There are lots and lots of ways. I prefer javascript ( with jquery) ajax calls

$.post('login.php', function(data) {
  alert( "returned " + data + " from php page");
});

see jQuery documentation for more details.

If you need to do this serverside (in the c# code behind), let me know, I will write up some sample code.


There's no difference between submitting a form post to a PHP script or to a C# application or to whatever program written in whatever language. How the data is transferred is defined by Internet standards.

Of course, different implementations may have slightly different behaviors. For instance, PHP considers all input names that have square brackets in their name to be part of an array.

0

精彩评论

暂无评论...
验证码 换一张
取 消