-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhill_admin_articles_edit_exec.php
More file actions
83 lines (66 loc) · 2.41 KB
/
hill_admin_articles_edit_exec.php
File metadata and controls
83 lines (66 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?PHP
require_once("./include/membersite_config.php");
//create a variable if the user is already logged in.
$alreadyloggedin=1;
if(!$hill_func->CheckLogin())
{
$alreadyloggedin=0;
$username_for_comment_box=null;
header('Location:hill_login.php');
//exit;
}
else
{
$username_for_comment_box=$hill_func->UserFullName();
if(strtoupper($hill_func->UserType())!="ADMIN")
{header('Location:hill_login.php');}
}
?>
<div id="wrap">
<!-- Site header is called from site-header file -->
<?PHP include('site_header.php');?>
<div id="body_sty">
<?PHP
//session_start();
include "./include/hillarticleconfig.php";
//retrieve the main article
if(isset($_POST['artidtoupdate']) && strlen(trim($_POST['artidtoupdate']))>0 )
{
$updatearticle="UPDATE article
SET name = '".trim($hill_func->fix_intext($_POST['nametoupdate'])) ."',
title = '".trim($hill_func->fix_intext($_POST['titletoupdate'])) ."',
comments = '".trim($hill_func->fix_intext($_POST['commentstoupdate'])) ."',
art_summary = '".trim($hill_func->fix_intext($_POST['summarytoupdate'])) ."',
date_posted = '".date("Y-m-d",time()) ."',
categoryID = ".$hill_func->fix_intext($_POST['categoryIDtoupdate']) .",
artchild = ".$hill_func->fix_intext($_POST['artchildtoupdate']) ."
WHERE artid = ".$_POST['artidtoupdate']." ";
echo $updatearticle;
echo '<p>Current date '.date("Y-m-d",time()).'</p>';
if(!$updateresult = mysql_query($updatearticle))
{
echo '<p>Error in updating: <br/> '.mysql_error().'</p>';
}
else
{
echo '<p>Update Successfull: <br/> '.mysql_error().'</p>';
//unset the session variables
unset($_POST['artidtoupdate']);
unset($_POST['nametoupdate']);
unset($_POST['commentstoupdate']);
unset($_POST['summarytoupdate']);
unset($_POST['categoryIDtoupdate']);
unset($_POST['artchildtoupdate']);
}
}
else {echo '<p>Problem - Article ID not correct. Received: '.$_POST['artidtoupdate'].' Please check.</p>';}
?>
<form name="redirect_to_admin" action="hill_admin.php" method="get">
<input type="submit" value="Return back to Admin Page" />
</form>
<!-- code for the right box and footer -->
</div>
<!-- Right box with ads disabled for the admin pages -->
<!-- Site footer is called from site-footer file -->
<?PHP include('site_footer.php');?>
</div>