PHP Classes

File: example/app/views/form.php

Recommend this page to a friend!
  Classes of Dony   Kecik   example/app/views/form.php   Download  
File: example/app/views/form.php
Role: Auxiliary script
Content type: text/plain
Description: Example script
Class: Kecik
MVC framework library as single PHP file
Author: By
Last change:
Date: 9 years ago
Size: 824 bytes
 

Contents

Class file image Download
<?php
 
if ($id != '') {
   
$sql = "SELECT * FROM data WHERE id=$id";
   
$res = mysqli_query($this->dbcon, $sql);
    while(
$data = mysqli_fetch_object($res) ) {
     
$nama = $data->nama;
     
$email = $data->email;
    }
  }
?>
<br />
<form method="POST" action="<?php echo $url ?>">
  <div class="form-group">
    <label for="nama">Nama</label>
    <input type="text" class="form-control" id="nama" name="nama" placeholder="Masukan Nama" value="<?php echo (isset($nama))? $nama:''; ?>" />
  </div>
  <div class="form-group">
    <label for="email">Email</label>
    <input type="email" class="form-control" id="email" name="email" placeholder="Masukan Email" value="<?php echo (isset($email))? $email:''; ?>" />
  </div>
 
  <button type="submit" class="btn btn-default">Simpan</button>
</form>