Welcome Guest, Not a member yet? Register   Sign In
problem with form_open()

if i use the form_open function, don't will get the right link, it just put it on the normal url, just remove the old (function, and class).

is it s bug ?

sorry for my bad english.

[eluser]Phil Sturgeon[/eluser]
The way form_open() works is so you can give it a controller and it will make it into a local site url. In the helper the code is this:

$form = '<form action="'.$CI->config->site_url($action).'"';

If you want to create a form to an external location, just use HTML:

Quote:<form action="http://google.com" method="post">

if i use $this->data['someContent'] .= '<form action="'.$CI->config->site_url("welcome/login").'"';

on this url


codeigniter navigate me to


[eluser]Phil Sturgeon[/eluser]
If only you could understand what I am typing.


Quote:$this->data[’someContent’] .= ‘<form action="http://google.com" method="post">’;

but i dont want to navigate trough my CI with absolute paths.

i don't can use relative paths to jump throug the functions ?

[eluser]Phil Sturgeon[/eluser]
I thought you didnt want to. In that case just use:


[quote author="thepyromaniac" date="1186765251"]I thought you didnt want to. In that case just use:


thats my problem, if i use it, the link isnt right....

pour example i use it on welcome/login, i write: $this->data['someContent'] .= '<form action="'.("welcome/login").'"';

if i click on the submit button im on the page


the second index.php is wrong, it's a 404 page =(

i hope now you understand me, i am very sorry for my bad english,
nice greez from germany.

What does your config/routes.php show ?

[eluser]Michael Wales[/eluser]
$this->data[’someContent’] .= ‘<form action=“‘.("welcome/login").‘“’;

That's wrong - you are not including any sort of function for the framework to know what you want it to do with the path.

First, I would just place this directly in my view - rather than passing it from my controller. Is there a reason you want to pass it from the controller?

If placed in view:
&lt;?= form_open('welcome/login'); ?&gt;

If in controller:
$data['open_Form'] = form_open('welcome/login');

If you get the wrong URL after that - please tell us what the URL you are getting is. I guarantee it's an issue with your config.php (or maybe some crazy URI routing).

Theme © iAndrew 2016 - Forum software by © MyBB