try { include 'timeline.php'; require_once 'base.php'; $username = $_SESSION['user_id']; $TL = new TimeLine(); if (isset($_POST['no'])) { $no = $_POST['no']; } if (isset($_POST['author'])) { $author = $_POST['author']; } if (empty($username)) { ?> <?php echo "<script>alert('로그인 해주세요'); location.replace(\"contents.php\")</script>"; } else { if ($username != $author) { ?> <?php echo "<script>alert('다른사람 글 삭제 할 수 없다'); location.replace(\"contents.php\")</script>"; } else { $TL->delete($no); ?> <?php echo "<script>alert('삭제'); location.replace(\"contents.php\")</script>"; } } } catch (Exception $e) { header("Location:error.php"); }
<?php # Ex 5 : Delete a tweet try { include "timeline.php"; $database = new TimeLine(); $database->delete((int) $_POST["count"]); header("Location:index.php"); } catch (Exception $e) { header("Location:error.php"); }
<?php include "timeline.php"; $timeline = new TimeLine(); # Ex 5 : Delete a tweet try { $input_no = $_POST["num"]; $timeline->delete($input_no); header("Location:index.php"); } catch (Exception $e) { header("Location:error.php"); }
<?php # Ex 5 : Delete a tweet require_once "timeline.php"; $timeline = new TimeLine(); try { $timeline->delete($_POST['no']); header("Location:index.php"); } catch (Exception $e) { header("Loaction:error.php"); }
<?php # Ex 5 : Delete a tweet try { // call delete function include 'timeline.php'; $timeline = new TimeLine(); $no = $_POST["no"]; $timeline->delete($no); header("Location:index.php"); } catch (Exception $e) { header("Location:error.php"); }
<?php # Ex 5 : Delete a tweet try { include "timeline.php"; $tl = new TimeLine(); $getno = isset($_POST["no"]) ? $_POST["no"] : ' '; $tl->delete($getno); header("Location:index.php"); } catch (Exception $e) { header("Location:error.php"); }
<?php require_once "timeline.php"; try { $timeline = new TimeLine(); $timeline->delete($_POST["no"]); #call delete function header("Location:index.php"); } catch (Exception $e) { header("Loaction:error.php"); }
<?php # Ex 5 : Delete a tweet try { require_once 'timeline.php'; $d_class = new TimeLine(); $d_num = $_GET["twnum"]; $d_class->delete($d_num); header("Location:index.php"); } catch (Exception $e) { header("Loaction:error.php"); }