G
Guest
I have a simple form question. I order to access a payment gateway I have a
asp.net page which has to have a form that use POST for method and _blank for
target. Before the information of the form can be send of, a checksum has to
be calculated. I want to calculate the checksum server side for security
reasons. The way I do it the checksum is not calculated before the form I
posted. The following is simplified content of the aspx .
<html>
<header>
<%@ Import Namespace=â€System.Security.Cryptography “ %>
<script language=â€C#†runat=â€serverâ€>
void Page_Load(Object sender, EventArgs e) {
PageDataBind();
}
string makeMD5( string s) {
return MD5(s); // The code here is VERY simplified
}
</script>
</header>
<body>
<form id=https://secure.paymentgateway.com/window.php method=â€postâ€
target=â€_blankâ€>
<input type=â€hidden†name=â€checksumMD5†value=<%# makeMD5( makeMD5(
amount.Value.ToString() ); %> />
<input type=â€text†id=â€amount†runat=â€server†/>
<input type=â€submit†value=â€submit>
</form>
</body>
<html>
I have also tried to let form=â€server†and that way calculate in a cs file
server side. I just could’t if any function I C# waould let me form posting
to the payment gateway page.
Any suggestions?
Thanks in advance for any help,
asp.net page which has to have a form that use POST for method and _blank for
target. Before the information of the form can be send of, a checksum has to
be calculated. I want to calculate the checksum server side for security
reasons. The way I do it the checksum is not calculated before the form I
posted. The following is simplified content of the aspx .
<html>
<header>
<%@ Import Namespace=â€System.Security.Cryptography “ %>
<script language=â€C#†runat=â€serverâ€>
void Page_Load(Object sender, EventArgs e) {
PageDataBind();
}
string makeMD5( string s) {
return MD5(s); // The code here is VERY simplified
}
</script>
</header>
<body>
<form id=https://secure.paymentgateway.com/window.php method=â€postâ€
target=â€_blankâ€>
<input type=â€hidden†name=â€checksumMD5†value=<%# makeMD5( makeMD5(
amount.Value.ToString() ); %> />
<input type=â€text†id=â€amount†runat=â€server†/>
<input type=â€submit†value=â€submit>
</form>
</body>
<html>
I have also tried to let form=â€server†and that way calculate in a cs file
server side. I just could’t if any function I C# waould let me form posting
to the payment gateway page.
Any suggestions?
Thanks in advance for any help,