-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathurls.php
63 lines (52 loc) · 961 Bytes
/
urls.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
function redirect($url)
{
header('Location: ' . $url);
exit();
}
function flashNextURL($url)
{
$_SESSION['next_url'] = $url;
}
function getFlashedNextURL()
{
if (isset($_SESSION['next_url'])) {
$url = $_SESSION['next_url'];
unset($_SESSION['next_url']);
return $url;
}
return null;
}
function getPostViewURL($post_id, $hidden = false)
{
return 'post.php?id=' . $post_id . ($hidden ? '&hidden=1' : '');
}
function getPostEditURL($post_id)
{
return 'edit.php?id=' . $post_id;
}
function getPostDeleteURL($post_id)
{
return 'delete.php?id=' . $post_id;
}
function getContactURL()
{
return 'contact.php';
}
function getPostCreateURL()
{
return 'write.php';
}
function getLoginURL()
{
return 'login.php';
}
function getLogoutURL()
{
return 'logout.php';
}
function getHomeURL()
{
return 'index.php';
}