Welcome Guest, Not a member yet? Register   Sign In
PROBLEM: Submit doesn't go to correct page
#1

[eluser]Unknown[/eluser]
When I click the submit button in the form, instead of going to say 'vendor/searchresults'. The address it goes to is the address of the current page plus the address of the target page. Please help.
#2

[eluser]Rok Biderman[/eluser]
Well, since you didn't put any of the code all I can tell you is check you slashes and dots. As well in the index.php and config/config.php. If it doesn't help post again with more details.
#3

[eluser]SitesByJoe[/eluser]
Use CI's form helper for your opening for tag so you don't have to worry about pathing:

Code:
<?php echo form_open('controller/function'); ?>
#4

[eluser]dark_lord[/eluser]
Or if you are using native <form> tag, you can use the following:

Code:
<form method="post" action="<?php echo site_url('controller/function'); ?>">
#5

[eluser]tomcode[/eluser]
Quote: the address of the current page plus the address of the target page

You have to use an absolute address for the form, otherwise the segments are appended to the current URL, same behavior as with the images, scripts, links, etc...

There is one other way, which consists of adding a base tag to the header of the document, but this requires to adapt all URL's in the page.




Theme © iAndrew 2016 - Forum software by © MyBB