/ Published in: Other
Expand |
Embed | Plain Text
<? if($_REQUEST['article']<>0){ $display_form = true; $section = new newssection(); if($_REQUEST['action']=="update"){ $errors = array(); if(sizeof($errors)==0){ if($_REQUEST["section"]<>0){ $section->id = clean_db($_REQUEST["section"]); } $section->title = clean_db($_POST["title"]); $section->text1 = clean_db($_POST["text1"]); $section->text2 = clean_db($_POST["text2"]); $section->save(); } else { //do something with errors } } if($_REQUEST['action']=="delete"){ } if($display_form){ ?> <h1>Amend <?=($section->id<>0)? "<u>".$section->title."</u>" : "";?>Section</h1> <p>If one column is used then it will expand full width else a two column layout will be used.</p> <form action="" method="post"> <div class="frow"><label>Title</label><input type="text" name="title" value="<?=$section->title;?>"/></div> <div class="frow"><label>Text 1</label><textarea name="text1"><?=$section->text1;?></textarea></div> <div class="frow"><label>Text 2</label><textarea name="text2"><?=$section->text21;?></textarea></div> <div class="frow"><label> </label> <input type="hidden" name="section" value="<?=$section->id;?>"/> <input type="hidden" name="action" value="update"/> <input type="hidden" name="article" value="<?=$_REQUEST["article"];?>"/> <input type="submit" name="submit" value="Submit"/></div> </form> <? } } else { ?> <p>The related article could not be found.</p> <? } ?>
You need to login to post a comment.
