[eluser]jairoh_[/eluser]
[quote author="cidevelopment" date="1380199946"]Hello Community,
Following is scenario.
SCENARIO 1 :
Suppose I am adding property with following link
/property/add
I implemented server side validation. If there is something wrong with form. It come back to same page
/property/add and loses entered data.
Question 1 > How to retain form value?
SCENARIO 2 :
I need to add room against property. URL is
/property/addroom/12 where 12 is property id.
> If form fails , it should come back to /property/addroom/12 rather than /property/addroom
> When it is successfull it should come back to /property/room/12 to list specific property rooms listing.
Please guide step by step.
Thanks.
[/quote]
SCENARIO 1:
if you're using CI's Form Validation library class, in your form u can add set_value()
ex.
Code:
form_input( 'username', set_value( 'username' ) );
SCENARIO 2:
sir i would like to tell you that you should not use $_GET/uri values in inserting a data, instead use $_POST for security purposes. $_GET is just intended for getting data not posting
hope this helps.