form validation:

[eluser]ken kloud[/eluser]
this form is from the user guide in form validation:


<title>My Form</title>

<?=$this->validation->error_string; ?>

<?=form_open('form'); ?>

&lt;input type="text" name="username" value="&lt;?=$this-&gt;validation->username;?&gt;" size="50" />

&lt;input type="text" name="password" value="&lt;?=$this-&gt;validation->password;?&gt;" size="50" />

<h5>Password Confirm</h5>
&lt;input type="text" name="passconf" value="&lt;?=$this-&gt;validation->passconf;?&gt;" size="50" />

<h5>Email Address</h5>
&lt;input type="text" name="email" value="&lt;?=$this-&gt;validation->email;?&gt;" size="50" />

<div>&lt;input type="submit" value="Submit" /&gt;</div>



form.php -controller

function index()
$this->load->helper(array('form', 'url'));


$rules['username'] = "required";
$rules['password'] = "required";
$rules['passconf'] = "required";
$rules['email'] = "required";


$fields['username'] = 'Username';
$fields['password'] = 'Password';
$fields['passconf'] = 'Password Confirmation';
$fields['email'] = 'Email Address';


if ($this->validation->run() == FALSE)


&lt;title&gt;My Form&lt;/title&gt;

<h3>Your form was successfully submitted!</h3>

<p>&lt;?=anchor('form', 'Try it again!'); ?&gt;</p>



This is my following errors in the browser:


validation->error_string; ?&gt;

then in every fields of the textbox the php code will see: example:&lt;?=$this->validation->username;?&gt;
this code is in the textbox...

and my problem is if i'am doing right,, because this code did not run,, but in the user guide its run very clear to understand but in testing it, its not...

sorry for this silly question...
thank you for the replys...

You have to edit php.ini to enable fast tags

anyway to make it work change to &lt;?php

You can also enable the "rewrite_short_tags" option in your config.php file if you don't have access to your hosting php.ini file. There might be an impact on performance when doing this but it's a quick fix.

that's quitely right...

[eluser]ken kloud[/eluser]

thanks for the reply!!!

maraming salamat poh...

thank you very much...

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.