home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Practical Internet Web Designer 89
/
PIWD89.iso
/
pc
/
CONTENTS
/
DEVELOPER
/
TUTORIAL_FILES
/
Pages90-91
/
extracode.php
< prev
next >
Wrap
PHP Script
|
2003-12-08
|
1KB
|
50 lines
<?php
if($edit == true)
{
?>
<form method="post" action="edit.php">
<p>Title:
<br /><input name="contentTitle" id="contentTitle" class="text" value="<?=$title?>" /></p>
<p>Content:
<br /><textarea name="contentText" id="contentText" class="largeText"><?=$content?></textarea></p>
<p>Category:
<br /><select name="catID" id="catID">
<?php
while ($row = mysql_fetch_array($result)) {?>
<option value="<?=$row['catID']?>"<?php
if ($row['catID'] == $catID)
{
print " selected=\"selected\"";
}
?>><?=$row['catName']?></option>
<?php
}
?>
</select></p>
<input type="hidden" name="contentID" id="contentID" value="<?=$_GET['contentID']?>" />
<p><input type="submit" name="btnEdit" value="Update Item" class="submit" /></p>
</form>
<?php
}
else
{
?>
<p>Select the content you wish to edit or delete from the list below by clicking on the title.</p>
<ul>
<?php
while ($row = mysql_fetch_array($result)) {
print("<li><a href=\"edit.php?edit=true&contentID=" . $row[contentID] . "\">" . $row[contentTitle] . "</a></li>\n");
}
?>
</ul>
<?php
}
?>