Example #1
0
  <fieldset class="maintform">
    <legend><?php 
echo $id ? 'ID: ' . $id : 'Add a Category';
?>
</legend>
    <ul>
    <li><label for="cat_name" class="required">Category</label><br />
      <input type="text" name="cat_name" id="cat_name" class="required" 
      value="<?php 
echo $item->getCat_name();
?>
" /></li>
    <li><label for="cat_description">Description</label><br />
      <textarea rows="5" cols="60" name="cat_description" 
      id="cat_description"><?php 
echo $item->getCat_description();
?>
</textarea></li>
    <li><label for="cat_image" >Image</label><br />
      <input type="text" name="cat_image" id="cat_image" 
      value="<?php 
echo $item->getCat_image();
?>
" /></li>
    </ul>
    
    <?php 
// create token
$salt = 'SomeSalt';
$token = sha1(mt_rand(1, 1000000) . $salt);
$_SESSION['token'] = $token;
Example #2
0
  <fieldset class="maintform">
    <legend><?php 
echo $id ? 'ID: ' . $id : 'Add a Category';
?>
</legend>
    <ul>
    <li><label for="cat_name" class="required">Category</label><br />
      <input type="text" name="cat_name" id="cat_name" class="required" 
      value="<?php 
echo htmlspecialchars($item->getCat_name());
?>
" /></li>
    <li><label for="cat_description">Description</label><br />
      <textarea rows="5" cols="60" name="cat_description" 
      id="cat_description"><?php 
echo htmlspecialchars($item->getCat_description());
?>
</textarea></li>
    <li><label for="cat_image" >Image</label><br />
      <input type="text" name="cat_image" id="cat_image" 
      value="<?php 
echo htmlspecialchars($item->getCat_image());
?>
" /></li>
    </ul>
    
    <?php 
// create token
$salt = 'SomeSalt';
$token = sha1(mt_rand(1, 1000000) . $salt);
$_SESSION['token'] = $token;