I have a simple form written in PHP using the Codeigniter framework. One of the fields submitted by the form holds a url in the form '<http://somedomain.com/web/Api/v2.3/offers.json>
 This field and others in the form group are then inserted into a MYSQL database table.

The problem is that once inserted into the column field it loses all its formatting so that what ends up in the table is something like this:

httpsomedomaincomwebApiv23offersjson

This line of code is from the form class for the field from the views modul:

This is the line of code is from the controller module that gets the form data and packages into an array ready for the models module to turn it into an SQL string:

'api\_url' => $this->cleanInput($this->input->post('api\_uri')),

By runnning an application called Burpsuite, which is basically a proxy application running on my local machine, I intercepted the string just after the form being submitted and as far as I can see, the URL is properly formatted/encoded as shown below:

api\_uri=http%3A%2F%2Fsomedomain.com%2Fweb%2Fapi%2F2.3%2Fjson&submit=

However chcking the field in the MYSQL database the entry looks like this:

httpsomedomaincomwebapi23son

So sometime between the form being submitted and inserted into the database the string loses it's url encoding.

Just as a check I did an insert of a url formatted string into the database field using the MYSQL comnandline CLI, and the string got inserted perfectly retaining the URL formatting.

Any ideas/help will be much appreciated