/var/www/(Del)asld.org.hk/webadmin/newsmodify.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
    
require("configure.php");

    if (!isset(
$_SESSION["cmslogin"])) {
        
header("Location: login.php");
        exit;
    }

    
$newsid    $_POST["newsid"];
    
$newstitle htmlspecialchars($_POST["newstitle"], ENT_QUOTES);
    
$newsdesc  preg_replace("/'/""\'"$_POST["newsdesc"]);
    
$newslink  htmlspecialchars($_POST["newslink"], ENT_QUOTES);
    
$newscover htmlspecialchars($_POST["newscover"], ENT_QUOTES);

    
$sql "update news set newsid='$newsid', newstitle='$newstitle', newsdesc='$newsdesc', newslink='$newslink', newscover='$newscover' ";
    
$sql .= "where newsid=" $newsid " ";

    
mysql_query($sql);
    
mysql_close($dbh);

    
header("Location: newsindex.php?msg=Update Successful");
?>