home *** CD-ROM | disk | FTP | other *** search
/ Practical Internet Web Designer 89 / PIWD89.iso / mac / contents / developer / tutorial_files / Pages90-91 / extracode < prev    next >
Encoding:
Text File  |  2003-12-07  |  1.0 KB  |  44 lines  |  [TEXT/ttxt]

  1. <?php
  2. if($edit == true)
  3. {
  4. ?>
  5. <form method=”post” action=”edit.php”>
  6. <p>Title:
  7. <br /><input name=”contentTitle” id=”contentTitle” class=”text” value=”<?=$title?>” /></p>
  8. <p>Content:
  9. <br /><textarea name=”contentText” id=”contentText” class=”largeText”><?=$content?></textarea></p>
  10. <p>Category:
  11. <br /><select name=”catID” id=”catID”>
  12. <?php
  13. while ($row = mysql_fetch_array($result)) {?>
  14. <option value=”<?=$row[‘catID’]?>”<?php
  15. if ($row[‘catID’] == $catID)
  16. {
  17.     print “ selected=\”selected\””;
  18. }
  19. ?>><?=$row[‘catName’]?></option>
  20. <?php
  21. }
  22. ?>
  23. </select></p>
  24. <input type=”hidden” name=”contentID” id=”contentID” value=”<?=$_GET[‘contentID’]?>” />
  25. <p><input type=”submit” name=”btnEdit” value=”Update Item” class=”submit” /></p>
  26. </form>
  27. <?php
  28. }
  29. else
  30.  
  31.  
  32. {
  33. ?>
  34. <p>Select the content you wish to edit or delete from the list below by clicking on the title.</p>
  35. <ul>
  36. <?php
  37. while ($row = mysql_fetch_array($result)) {
  38.     print(“<li><a href=\”edit.php?edit=true&contentID=” . $row[contentID] . “\”>” . $row[contentTitle] . “</a></li>\n”);
  39. }
  40. ?>
  41. </ul>
  42. <?php
  43. }
  44. ?>