Hey,
I have a form that inserts/updates data to a table.
How should I write if I want my field/string to replace specialcharacters.
In ASP I would gather the info this way
var information = Request.Form('information');
and replce the ' character this way
information= String(information);
information= information.replace(/'/g,"''");
How would this one look in PHP?
this was my main question, but I'm also wondering how to replace the special Swedish/german characters å, ä, ö.
Once again I was successful in ASP by writing this
var first = Request.Form("firstname");
var last = Request.Form("lastname");
first = String(first);
first = first.replace(/'/g,"");
first = first.replace(/[ao]/ig,"");
first = first.replace(/*/g,"%");
last = String(last);
last = last.replace(/'/g,"");
last = last.replace(/[ao]/ig,"");
last = last.replace(/*/g,"%");
This one gathers the Firstname and Lastname and then replaces å,ä,ö to a and o.
With this a user can search a name, say Jorgen Akesson and still get the result Jörgen Åkesson.
----> SO if anyone could help me out with these two questions, I would appreciate it a lot!