Comment

DSI_UPDATE_FORM

Estimated reading: 1 minute 34 views

This function will help you to generate dynamic update forms without hard coding each and every fields.

\DevSecIt\FORM\DSI_UPDATE_FORM($table, $data_array, $required_array);

Demo 1 – [Suppose you want to make a user update form with the following fields]

<?php 
require_once __DIR__."/config.php";

$fields_array = ["name", "phone", "email", "password", "address", "city", "district","state"];

$required_array  = ["name", "phone", "password" ];

$form = \DevSecIt\FORM\DSI_UPDATE_FORM("users", $fields_array, $required_array);

echo $form; 

Demo 2 – [Suppose you want to make a user update form with the following fields and files also]

<?php 
require_once __DIR__."/config.php";

$fields_array = ["name", "phone", "email", "password", "address", "city", "district","state","photo", "resume"];

$required_array  = ["name", "phone", "password" ];

$files_array = ["photo", "resume"];

$form = \DevSecIt\FORM\DSI_UPDATE_FORM( "users", $fields_array, $required_array, $files_array);

echo $form; 

Leave a comment

Share this Doc

DSI_UPDATE_FORM

Or copy link

CONTENTS