I'm encoding URL's using javascript's encodeURIComponent() function when a form is submitted:
<form name="form" action="actions.php" method="post">
<input type="text" name="url" id="url" value="http://">
<script type="text/javascript">
function encodeLinks(){
var e = document.getElementById('url')
e.value = encodeURIComponent(e.value);
}
</script>
<button type="submit" class="btn btn-primary" onclick="encodeLinks()">Submit</button>
</form>
What is the most efficient way to get that data back into javascript on the actions page in order to decode it and then use it in a mysql query?