CodeIgniter Forums

Full Version: Posting URL / Links in an input via post breaks certain links.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Unknown[/eluser]
I am submitting links via a text input to a controller.

Certain links, such as this one work perfectly.

http://pic.dhe.ibm.com/infocenter/tivihe...Sample.csv

However, links such as this one return an error:

http://somepage.somewhere.co.uk/place/ge...Format=csv

A PHP Error was encountered
Severity: Warning
Message: fopen(http //somepage.somewhere.ok.ut/place/geoserver/ows?service=WFS&request=GetFeature&versi;): failed to open stream: No such file or directory
Filename: controllers/controller.php
Line Number: 27
If I paste the link directly in the controller, it works however.

Basically, it breaks already here. If I try to echo out the input value, it returns the same value as the php error message.

Code:
class Controller extends CI_Controller
{
public function index()
{
    $data['page_title'] = "Title";
    $config['global_xss_filtering'] = FALSE;
    $this->load->view('header', $data);

    $this->load->database();

    $this->load->dbforge();

    $csvLocationUrl = ($this->input->post('csvLocationUrlTextBox')) ?: FALSE;

El Forum

[eluser]InsiteFX[/eluser]
PHP Manual urlencode