Presentation is loading. Please wait.

Presentation is loading. Please wait.

Webpage and database design for Chia-Yao Chien.

Similar presentations


Presentation on theme: "Webpage and database design for Chia-Yao Chien."— Presentation transcript:

1 Webpage and database design for http://www.hosannabroadcasting.comwww.hosannabroadcasting.com Chia-Yao Chien

2 Motivation The fundamental concept behind Hosanna Broadcasting Network (HBN) is to target the most dynamic emerging markets on earth: Africa, the Middle East, Europe and India. HBN is the first and only Christian radio network to market with a wide range of coverage. HBN is dedicated to bring the message of Jesus Christ to the under-served areas via high quality digital satellite radio to parts of the world that have not been penetrated by the gospel.

3 Theory Basically the website is built on a server company called ”startlogic”. They allow clients to access the database using phpmyadmin and php webpages.

4 Design Login page Register Form for first time user Forgot ID Forgot password After Login – Chat room – Guestbook

5 Design Administrator page – asc/desc order – able/disable user – Email – Newletters

6 Design Blog – Entry/re-entry for the content – Blog display page – Calendar mode for the blog – Favorites – Contact

7 Session( ) Session support in PHP consists of a way to preserve certain data across subsequent accesses. This enables you to build more customized applications and increase the appeal of your web site. How to access it – session_start() – $_session[‘save_this’] = $save_this_one;

8 Session( ) How to read the data from session – session_start() – $save_from_prev_page = $_session[‘save_this’]; Note: php cannot output ANYTHING before calling session_start(), (or other functions that need to send headers, like cookie setting).

9 Cookie( ) setcookie() defines a cookie to be sent along with the rest of the HTTP headers. Like other headers, cookies must be sent before any output from your script (this is a protocol restriction). This requires that you place calls to this function prior to any output, including and tags as well as any whitespace.

10 Cookie( ) How to us cookie <?php $value = 'something from somewhere'; setcookie("TestCookie", $value); setcookie("TestCookie", $value, time()+3600); /* expire in 1 hour */

11 Cookie( ) setcookie("TestCookie", $value, time()+3600, "/~rasmus/", ".example.com", 1); ?> – Path The path on the server in which the cookie will be available on. – Domain The domain that the cookie is available. – Secure Indicates that the cookie should only be transmitted over a secure HTTPS connection.

12 Cookie( ) Access cookie – echo $_COOKIE["TestCookie"]; – if($_COOKIE['name'] == null){ die; } Delete cookie – setcookie ("TestCookie", "", time() - 3600);

13 Blog Give and initial date, and if the current date < initial date, go to the initial date, else, go to the current. Use $_GET['date'] to get the date on the url Flipbar output the url with dates

14 Blog $today = date('Ymd'); if (isSet($_GET['date'])) { if ($_GET['date'] < $initial_entry_date) { // Go to first entry if the specified date is earlier than range $date = $initial_entry_date; } elseif ($_GET['date'] > $today) { // Go to last entry if specified date is later than range $date = $today; } else { $date = $_GET['date']; } } else { $date = $today; }

15 Blog $prevdate = $date - 1; $nextdate = $date + 1; if ($date == $initial_entry_date) { $flipbar = "\n Next -- > \n"; } elseif ($date == $today) { $flipbar = "\n \n"; } else { $flipbar = "\n Next --> \n"; }

16 Blog with Calendar mode Use date() and mktime() calculate the dates for the calendar – $date = mktime (0, 0, 0, $month, $date, $year); – $actualDate = date(“m-d-y", $Febdate2[$i]); In sql query, take out all the dates that matches with the month of the page

17 Calendar Mode


Download ppt "Webpage and database design for Chia-Yao Chien."

Similar presentations


Ads by Google