Welcome Guest, Not a member yet? Register   Sign In
FORM / Redirection help required!
#3

[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 Smile


hope this helps.


Messages In This Thread
FORM / Redirection help required! - by El Forum - 09-26-2013, 05:52 AM
FORM / Redirection help required! - by El Forum - 09-26-2013, 07:31 AM
FORM / Redirection help required! - by El Forum - 09-26-2013, 06:54 PM
FORM / Redirection help required! - by El Forum - 09-30-2013, 04:08 AM
FORM / Redirection help required! - by El Forum - 10-01-2013, 04:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB