Is it possible to post variables/values from a PHP page to an ASP.NET Webform?
I thought about using an intermediate HTML page to post the PHP value to but my problem is ASP.NET does not support request.form like classic ASP, basically to receive the value and then to pass it on...
I am really having a hard time finding the correct way or even how to do this and if this would be possible!!!
You could post a from through the get method, which puts it all in the querystring. ASP.NET does support Request.Form I believe, but I would think that it might only work through postback of the same ASPX page, not through redirect.
Brian
"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4).
The problem with using Querystrings is that there will be sensitive data OR a User ID being sent which I don't want to expose! The project I am working on involves connecting my application (ASP.NET) to a Mambo application/ portal (PHP) which is being developed
somewhere else in the country!
So when a user of the portal clicks onto the link i.e. (www.google.co.uk) there user id can be posted with it to the application I am developing! Once receiving the User id I can then run checks against relevant data
sources to validate and authenticate the user as a genuine user etc... This is why I thought about using an intermediate (HTML) page??? But I’m really not sure how this could be done!!! Partly due to asp. Net’s lack of 'Request.Form' else I guess this would
be an easy process... if that make's sense!
I would consider writing the values to a database or a file of some sort as the intermediary. That is the only way I could think of. You can't integrate the two otherwise; but you may be able to use an intermediary in that respect.
Brian
"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4).
You said ASP.NET does not support request.form like classic ASP, but I fail to see how it doesn't. Just put request.form("ControlID"), and you should be good to go.
I think though that only works on postback because of how the form post works, but I'm not exactly sure about that... I think that because of how cross page posting works now in 2.0....
Brian
"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4).
Hi, did anyone ever really figure this out? I'm not an ASP programmer by any means but I am faced with a similar problem:
I have a Microsoft StoreFront shopping cart that I need to post data (Add to Cart) to from HTML/PHP (residing on a Linux server). Ideally I'd like to be able to formulate the form post to include the ID of the product in the database and when the StoreFront
server receives the form post it will populate the user's shopping cart with a defined quantity of that product. Simple concept I thought but I'm running into a lot of difficulty. Is this even possible? I am using the following as my postback javascript:
The problem with using Querystrings is that there will be sensitive data OR a User ID being sent which I don't want to expose! The project I am working on involves connecting my application (ASP.NET) to a Mambo application/ portal (PHP) which is being developed
somewhere else in the country!
By definition, if this information is available client side then it is already exposed. It doesn't really matter if you are using form submission or query string parameters. Given that you are "transferring" the client piece from one server to a different
one then the client will have to have knowledge of the credentials necessary to make that work. Which means it can be captured / recorded.
The only time that information would not be exposed is if the client is talking to server A which directly talks to server B before giving the data to the client. However, that doesn't appear to be what you are doing.
ajevans
Member
20 Points
4 Posts
Passing Values from PHP to ASP.NET webform
Mar 02, 2006 10:24 AM|LINK
Is it possible to post variables/values from a PHP page to an ASP.NET Webform?
I thought about using an intermediate HTML page to post the PHP value to but my problem is ASP.NET does not support request.form like classic ASP, basically to receive the value and then to pass it on...
I am really having a hard time finding the correct way or even how to do this and if this would be possible!!!
Please help anyone....
Thanks.
bmains
All-Star
29116 Points
5886 Posts
MVP
Re: Passing Values from PHP to ASP.NET webform
Mar 02, 2006 11:38 AM|LINK
Hey,
You could post a from through the get method, which puts it all in the querystring. ASP.NET does support Request.Form I believe, but I would think that it might only work through postback of the same ASPX page, not through redirect.
"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4).
ajevans
Member
20 Points
4 Posts
Re: Passing Values from PHP to ASP.NET webform
Mar 02, 2006 12:05 PM|LINK
The problem with using Querystrings is that there will be sensitive data OR a User ID being sent which I don't want to expose! The project I am working on involves connecting my application (ASP.NET) to a Mambo application/ portal (PHP) which is being developed somewhere else in the country!
So when a user of the portal clicks onto the link i.e. (www.google.co.uk) there user id can be posted with it to the application I am developing! Once receiving the User id I can then run checks against relevant data sources to validate and authenticate the user as a genuine user etc... This is why I thought about using an intermediate (HTML) page??? But I’m really not sure how this could be done!!! Partly due to asp. Net’s lack of 'Request.Form' else I guess this would be an easy process... if that make's sense!
Help, help....
bmains
All-Star
29116 Points
5886 Posts
MVP
Re: Passing Values from PHP to ASP.NET webform
Mar 02, 2006 07:46 PM|LINK
Hey,
I would consider writing the values to a database or a file of some sort as the intermediary. That is the only way I could think of. You can't integrate the two otherwise; but you may be able to use an intermediary in that respect.
"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4).
Motley
Star
13789 Points
2449 Posts
MVP
Re: Passing Values from PHP to ASP.NET webform
Mar 03, 2006 05:16 PM|LINK
bmains
All-Star
29116 Points
5886 Posts
MVP
Re: Passing Values from PHP to ASP.NET webform
Mar 03, 2006 07:47 PM|LINK
Hey,
I think though that only works on postback because of how the form post works, but I'm not exactly sure about that... I think that because of how cross page posting works now in 2.0....
"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4).
Motley
Star
13789 Points
2449 Posts
MVP
Re: Passing Values from PHP to ASP.NET webform
Mar 06, 2006 04:28 AM|LINK
gccllc
Member
2 Points
1 Post
Re: Passing Values from PHP to ASP.NET webform
Aug 23, 2007 07:26 PM|LINK
Hi, did anyone ever really figure this out? I'm not an ASP programmer by any means but I am faced with a similar problem:
I have a Microsoft StoreFront shopping cart that I need to post data (Add to Cart) to from HTML/PHP (residing on a Linux server). Ideally I'd like to be able to formulate the form post to include the ID of the product in the database and when the StoreFront server receives the form post it will populate the user's shopping cart with a defined quantity of that product. Simple concept I thought but I'm running into a lot of difficulty. Is this even possible? I am using the following as my postback javascript:
<script language="javascript" type="text/javascript">
<!--
function __doPostBack(eventTarget, eventArgument) {
var theform;
if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) {
theform = document.Form2;
}
else {
theform = document.forms["Form2"];
}
theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
theform.__EVENTARGUMENT.value = eventArgument;
theform.submit();
}
// -->
</script>
And the following as my add to cart form:
nullstate
Member
2 Points
1 Post
Re: Passing Values from PHP to ASP.NET webform
Dec 10, 2007 08:27 PM|LINK
It appears that this is not possible. In all of my attempts, the form values are lost when they are posted from a php page to an aspx page.
gccllc, I have a very similar problem. How did you work around it?
EDIT: I stand corrected -- the person that created the form for me did not pass the values properly. Request.Form["param_name"] in C# works just fine.
ChrisLively
Member
87 Points
23 Posts
Re: Passing Values from PHP to ASP.NET webform
Jan 02, 2008 09:09 PM|LINK
By definition, if this information is available client side then it is already exposed. It doesn't really matter if you are using form submission or query string parameters. Given that you are "transferring" the client piece from one server to a different one then the client will have to have knowledge of the credentials necessary to make that work. Which means it can be captured / recorded.
The only time that information would not be exposed is if the client is talking to server A which directly talks to server B before giving the data to the client. However, that doesn't appear to be what you are doing.
Chris.