Example #1
0
    <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;
?>
    <input type="hidden" name="cat_id" id="cat_id" value="<?php 
echo $item->getCat_id();
?>
" />
    <input type="hidden" name="task" id="task" value="category.maint" />
Example #2
0
    <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;
?>
    <input type="hidden" name="cat_id" id="cat_id" value="<?php 
echo $item->getCat_id();
?>
" />
    <input type="hidden" name="task" id="task" value="category.maint" />