Welcome Guest, Not a member yet? Register   Sign In
POST METHOD PROBLEM (If input http://,ftp://)
#1

[eluser]Unknown[/eluser]
After I input http:// in textfield or textarea. I can't echo that variable(show nothing). please kindly check code as below.

It's work when i test on localhost . But when i test on external server It's not work.
And when i tested without CI (only php) like below It's work also.

Code:
<form method="post" action="doTest.php">
Website: <input type="text" name="website">
<input type="submit">
</form>

doTest.php
Code:
<?
echo $_POST['website'];
?>

environment:Codeigniter, Godaddy(php5.4 cpanel) Thank you in advance.

This is my code in CI:

Simple Code: Controller (Welcome)

Code:
public function test()
{
    $this->load->view('test');
}
public function doTest()
{
    $var = $this->input->post('bio');
    echo $var;
}

View (test.php):

Code:
<form action='../welcome/doTest' method="post">
<input class="form-control" type="text" name="bio"/>
<button class="btn btn-default" type="submit">Submit</button>
&lt;/form&gt;


work List:

aaaaa
'http://' (single quote added)
htp
://

not work:

http://
http://www.example.com
ftp://


sorry for poor english, Thank you in advance.
#2

[eluser]InsiteFX[/eluser]
It's Controller/Method.

Code:
&lt;form action='../welcome/doTest' method="post"&gt;

// should be
&lt;form action='welcome/doTest' method="post"&gt;
#3

[eluser]Unknown[/eluser]
[quote author="InsiteFX" date="1407588668"]It's Controller/Method.

Code:
&lt;form action='../welcome/doTest' method="post"&gt;

// should be
&lt;form action='welcome/doTest' method="post"&gt;
[/quote]

I try to use
Code:
&lt;form action='welcome/doTest' method="post"&gt;
But URL what i get is http://mydomain.com/welcome/welcome/doTest

Actually, I tested
Code:
&lt;form action='&lt;?=base_url('welcome/doTest');?&gt; method="post"&gt;
or &lt;form action='doTest' method="post"&gt;

It will send to http://mydomain.com/welcome/doTest

It's work if I use normal text like: aaa, text
But if input protocol name like http://, ftp:// It's not work.
#4

[eluser]Flemming[/eluser]
this seems like a similar problem to the one described here: https://ellislab.com/forums/viewthread/246197/

I think the issue could be with mod_security on your live server?
#5

[eluser]InsiteFX[/eluser]
it may need the index.php to work switch base_url() with site_url()

Code:
&lt;form action="&lt;?php echo site_url('welcome/doTest'); ?&gt;" method="post"&gt;




Theme © iAndrew 2016 - Forum software by © MyBB