@sulman8sauthorMar 27.2014 — #i just create an class object then call the error variable that have an array... so i want to call if it is required please tell me this is ok or not?
@ginerjmMar 27.2014 — #Without knowing what you have in the method I have no way of answering you. Frankly it sounds like you should be determining if there is an error before sending the output and if so, sen the error message instead of a call.
And - you really want to use a div tag to display the message?
@sulman8sauthorMar 27.2014 — #i am using <span>error</span> front of each field so when there would be an error so it will show to screen.. i just only want to know <?php echo $object->error['name']; ?> is this way right to call the variable? if so then i will have to do same for all fields..
@ginerjmMar 28.2014 — #If that is how you are getting errors then that code (while messy) will work.
I assume you are just automatically re-sending the user's screen back to them regardless of whether there are any errors or not, or do you have a way of recognizing if ANY errors are present?
@sulman8sauthorMar 28.2014 — #i am using errorcheck=true; a booelen variable if it true then show otherwise false and submit form... more how to shorten the code?
@ginerjmMar 28.2014 — #My personal phobia is to use php tags in my code. One is enough for a script usually. In your case, you apparently are doing some kind of call to check your inputs for errors, then when you create your output html you make another call (in php/out of php) to get the error message. Me - I would capture the error messages and then output them instead of making another call to generate the message. That can then be done by simply including the php var in the html code using a heredocs (look it up).
@ginerjmMar 29.2014 — #The code is fine. Your use of <? and ?> after each line of code is silly. Why do you keep going into php mode and then back out and then back???