Note that there are some explanatory texts on larger screens.

plurals
  1. POCodeIgniter, Smarty and Form Helper. Wrong Link on Submit
    primarykey
    data
    text
    <p>i have al litte problem with using CodeIgniter Form Helper and Smarty.</p> <p>I used this (<a href="https://github.com/EllisLab/CodeIgniter/wiki/Form-helper-with-Smarty" rel="nofollow">https://github.com/EllisLab/CodeIgniter/wiki/Form-helper-with-Smarty</a>) Form Helper Function.</p> <p>Now i have the addUser() Function in Controller</p> <pre><code> public function addUser(){ $this-&gt;load-&gt;helper('form'); $this-&gt;form_validation-&gt;set_rules('username', 'Benutzername', 'trim|required|min_length[4]|xss_clean'); $this-&gt;form_validation-&gt;set_rules('email', 'Email', 'trim|required|valid_email'); $this-&gt;form_validation-&gt;set_rules('password', 'Passwort', 'trim|required|min_length[4]|max_length[32]'); $this-&gt;form_validation-&gt;set_rules('con_password', 'Passwort bestätigen', 'trim|required|matches[password]'); if($this-&gt;form_validation-&gt;run() == FALSE){ echo "Error! User can not create"; }else{ $this-&gt;user_model-&gt;add_user(); echo "Done!"; } $this-&gt;smarty-&gt;display($this-&gt;tpl); } </code></pre> <p>And the following .TPL i used</p> <pre><code> {form url='pageadmin/addUser'} &lt;p&gt; &lt;label for="username"&gt;User Name:&lt;/label&gt; &lt;input type="text" id="username" name="user_name" /&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="email_address"&gt;Your Email:&lt;/label&gt; &lt;input type="text" id="email" name="email_address" /&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="password"&gt;Password:&lt;/label&gt; &lt;input type="password" id="password" name="password" /&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="con_password"&gt;Confirm Password:&lt;/label&gt; &lt;input type="password" id="con_password" name="con_password" /&gt; &lt;/p&gt; &lt;p&gt; &lt;input type="submit" value="Submit" /&gt; &lt;/p&gt; {form} </code></pre> <p>But now, when i try this. I have two problems. The first is, that the message "Error! User can not create" is all time showed when i called the function addUser(). The second problem is, that the url, which is generating by the form submit, is like this "<a href="http://dev.url.de/admin/addUser/dev.url.de/pageadmin/addUser" rel="nofollow">http://dev.url.de/admin/addUser/dev.url.de/pageadmin/addUser</a>".</p> <p>thank you very much and sorry for my bad english...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload