php - Preset the values of a form with data from a database -
i have form in web (build html). let's have values form can change, store them in database. want everytime user goes page form is, data database has read , form has filled information (for example, have field e-mail, want fill e-mail have in database). i've been looking way this, have not found "like". way can doing ajax request on javascript php script, connect db , data. once it, modify whole form via javascript, i'm not sure if safe enough. any ideas of how in different way or how safely enough? thank much. i'm not entirely convinced i'm answering right question, in order fill form, you'd have this: <form> <input name="username" value="<?php echo isset($datarow->username) ? htmlentities($datarow->username) : ""; ?>"> </form> i left out things not essential bring point across, if first time working html forms, may want read on well. of course first need data data...