CodeIgniter Forums
Posting URL / Links in an input via post breaks certain links. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Posting URL / Links in an input via post breaks certain links. (/showthread.php?tid=60111)



Posting URL / Links in an input via post breaks certain links. - El Forum - 01-17-2014

[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/tivihelp/v41r1/topic/com.ibm.ismsaas.doc/reference/AssetsImportCompleteSample.csv

However, links such as this one return an error:

http://somepage.somewhere.co.uk/place/geoserver/ows?service=WFS&request=GetFeature&version=1.1.0&typeName=ogd:ZONEOGD&srsName=EPSG:4326&outputFormat=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;



Posting URL / Links in an input via post breaks certain links. - El Forum - 01-17-2014

[eluser]InsiteFX[/eluser]
PHP Manual urlencode