I've got a Javascript script that sends 4 variables to a php page.
The fact is that, if one (or more) of these variables contain a character such as "&" or "%", it just won't work, it only sends what there was before "&" or "%". For instance, if the content of a variable is "Bolliger&Mabillard", the result will be "Bolliger". Obviously, this happens because the script separate each variable with an "&", how can I solve this?
Here's the script I'm talking about
<script type="text/javascript">
function save() 
{ 
 var shortname=location.hostname.replace(/^(www.|)([\w]+)(\..+|)/g, "$2");
 var url="http://"+window.location.hostname+"/";
 var link=window.location.href;
 var link_title="Bolliger&Mabillard"; 
 window.open("http://www.example.com/add.php?url=" + url + "&shortname="+shortname + "&link="+link + "&link_title="+link_title);
} 
</script>
 
     
    