Welcome Guest, Not a member yet? Register   Sign In
Problem post form
#1

[eluser]Unknown[/eluser]
Hello,

I'm pretty new with CI, and got a problem with posting a form
for example, i got this code in my view:

Code:
<form action="index.php/torrent/add" method="POST">
<input type="text" name="url"/>
<input type="submit" name="submit" value="Add"/>
</form>

and no matter what i set as action this form always directs to :
MYWEBSITEURL/system/get

information :
-system is my project folder
-i use IIS

mode rewrite :

<rule name="CI" enabled="true">
<match url="^(.*)$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:1}" appendQueryString="false" />
</rule>

anyone the solution ?

thanks,
#2

[eluser]CroNiX[/eluser]
Try using a full path instead of a relative path in your form action.
Code:
&lt;form action="/index.php/torrent/add" method="POST"&gt;
or better
Code:
&lt;?php echo form_open('torrent/add'); //will add the index.php automatically (if it's used in your config), POST method is default ?&gt;
#3

[eluser]Unknown[/eluser]
Afther a lot of testing, i decided to rewrite the project.
And now it actually works great. I did found some wierd test code in my base view.
But not really sure what the problem was.

Still thanks for the support!




Theme © iAndrew 2016 - Forum software by © MyBB