Specifications
The complete listing of story.php can be seen in listing 26.6.
LISTING 26.6 story.php Is Used to Create or Edit a Story
<?
include (“include_fns.php”);
if (isset($story))
$s = get_story_record($story);
?>
<FORM ACTION=”story_submit.php” METHOD=POST ENCTYPE=”multipart/form-data”>
<INPUT TYPE=HIDDEN NAME=”story” VALUE=”<? echo $story;?>”>
<INPUT TYPE=HIDDEN NAME=”destination” VALUE=”<? echo $HTTP_REFERER;?>”>
<TABLE>
<TR>
<TD ALIGN=CENTER>Headline<TD>
</TR>
<TR>
<TD><INPUT SIZE=80 NAME=”headline”
VALUE=”<? echo $s[headline];?>”></TD>
</TR>
<TR>
<TD ALIGN=CENTER>Page<TD>
</TR>
<TR>
<TD ALIGN=CENTER><? echo query_select(“page”,
“select p.code, p.description
from pages p, writer_permissions w
where p.code = w.page
and w.writer = ‘$auth_user’”, $s[page]);?></TD>
</TR>
<TR>
<TD ALIGN=CENTER>Story text (can contain HTML tags)</TD>
</TR>
<TR>
<TD><TEXTAREA COLS=80 ROWS=7 NAME=”story_text”
WRAP=VIRTUAL><? echo $s[story_text];?></TEXTAREA>
</TD>
</TR>
<TR>
<TD ALIGN=CENTER>Or upload HTML file</TD>
Building a Content Management System
C
HAPTER 26
26
CONTENT
MANAGEMENT
SYSTEMS
607
32 7842 ch26 3/6/01 3:36 PM Page 607










