devshb
Senior Member
United Kingdom
1904 Posts |
Posted - October 10 2005 : 14:28:40
|
It'll depend on the gateway that's being used; some gateways will be able to cater for it, while others will have problems (generally it depends on how the arguments are passed across; as form/field postings, or as url arguments) and how they're processed by the gateway asp page on your local site. Some gateway interfaces automatically translate/encode things to cater for it, and some don't.
What you could do is just wrap the field in the gateway asp file around a replace function. For example, you might change from:
thisproduct_name=objrs("itemname")
to:
thisproduct_name=Replace(objrs("itemname"),"&","and")
in your gateway asp file.
However, note that you can only use Replace on non-null values, otherwise you'll get a vbscript error, so if the value is optional, then you're better off with something like this:
if (objrs("itemname")<>"" and IsNull(objrs("itemname"))=false) then thisproduct_name=Replace(objrs("itemname"),"&","and") else thisproduct_name="" end if
If you want to apply that logic all over the place, then you can create a central function, added to, say, shop$db.asp:
Function TranslateArgForGateway(arg_in_value) if (arg_in_value="" or IsNull(arg_in_value)=true) then TranslateArgForGateway="" exit function end if TranslateArgForGateway=Replace(arg_in_value,"&","and") End Function
then use that in your gateway asp file when you create the values, such as:
thisproduct_name=TranslateArgForGateway(objrs("itemname"))
Simon Barnaby Developer [email protected] www.BigYellowZone.com
Edited by - devshb on October 10 2005 14:37:23 |
|
|