PHP Script

Below is the code snippet
  
  1. <?php
  2. $result =
mysql_query("SELECT * FROM content_type_field where field_ct_id = $field_ct_id") ;
  1. while($row = mysql_fetch_array($result))
  2. {
  3. $sid = $row['field_id'] ;
  4. $field_name = $row['field_name'] ;
  5. $field_type = $row['field_type'] ;
  6. $field_help = $row['field_help'] ;
  7. $required = $row['required'] ;
  8. ?>
  9.  
  <tr>
  1. <td><?php if($required=='1')
  2. {
  3. echo "<span class='required'> * </span>";
  4. }
  5. echo $field_name ; ?>:</td>
  6. <?php
  7. if($field_type == 'text')
  8. { ?>
  9. <td>
  10. <input type="text" name="<?php echo $sid ; ?>" id="<?php echo $sid ; ?>" class='validate[required,custom[onlyLetterNumber]] text-input' size="100" value="" />
  11. <?php echo $field_help ;?></td>
  12. <?php
  13. }
  14.  
  15. if($field_type == 'textarea')
  16. { ?>
  17. <td>
  18. <textarea name="<?php echo $sid ; ?>" id="<?php echo $sid ; ?>" ></textarea>
  19. <?php echo $field_help ;?></td>
  20. <?php
  21. }
  22.  
  23. if($field_type == 'file')
  24. { ?>
  25. <td>
  26. <input type="file" name="<?php echo $sid ; ?>" id="<?php echo $sid ; ?>" value="" />
  27. <?php echo $field_help ;?></td>
  28. <?php
  29. }
  30. ?>
  31.  
  32. <?php
  33. }
  34. ?>
Tags: 

If You Think This Post has helped you buy us a Coffee :)

Make Donation

  • Other: $

Donate now