-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcommon.php
41 lines (36 loc) · 900 Bytes
/
common.php
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
<?php
function Redirect_to($NewLocation)
{
header("Location:" . $NewLocation);
exit;
}
function limitingContent($content, $count)
{
if (strlen($content) > $count) {
$out = substr($content, 0, $count);
$out .= "....";
return $out;
} else {
return $content;
}
}
function ErrorMessage()
{
if (isset($_SESSION["ErrorMessage"])) {
$output = "<div class='alert alert-danger'>";
$output .= htmlentities($_SESSION["ErrorMessage"]);
$output .= "</div>";
$_SESSION["ErrorMessage"] = null;
return $output;
}
}
function SuccessMessage()
{
if (isset($_SESSION["SuccessMessage"])) {
$output = "<div class='alert alert-success'>";
$output .= htmlentities($_SESSION["SuccessMessage"]);
$output .= "</div>";
$_SESSION["SuccessMessage"] = null;
return $output;
}
}