This series of the videos explains how to create Photo Gallery using PHP, MySQL, ImageMagic and jQuery. Using PHP you will be able to add, modify and populate data stored on the MySQL Database and display records of all images on the page. ImageMagic will help us to resize and crop images to the relevant dimentions, while jQuery will provide the support in the presentation of the gallery. The last two chapters are dedicated to adding the earlier created gallery to our Content Management System. Over 4 hours of videos!!!

Dreamweaver tutorials

 
  • Link Exchange System with Dreamweaver CS3
  • Latest Links Page

This chapter will explain how to create a page which will display the latest links.

Open links_search_result.php and select the content starting from the line which reads:

<?php require_once('../Connections/conndb.php'); ?>

down to (including) the line which reads:

$queryString_rsLinks = sprintf("&totalRows_rsLinks=%d%s", $totalRows_rsLinks, $queryString_rsLinks); ?>

Copy and paste it at the top of the links_latest.php page, before <!DOCTYPE.

Now identify the line which reads:

<?php include ('../includes/search_engine.php'); ?>

Place your cursor at the end of this line and hit Enter on your keyboard to create a new line. Go back to links_search_result.php and copy the content from within the body tag starting with:

<p id="title"><?php if (isset($categ) && $categ != "") { echo $row_rsLinks['catname']; } else { ?>Search result<?php } ?></p>

and ending with (including):

<?php } // Show if recordset empty ?>

Go to links_latest.php and paste it on the newly created line. Go again to links_search_result.php, copy the following:

<?php mysql_free_result($rsLinks); ?>

and paste it in links_latest.php right at the end of the document, after closing </html> tag.

Now we will need to change a few things to make this page display the latest links. First of all identify this chunk of code:

if (isset($_GET['catid']) && $_GET['catid'] != "") {

$categ = $_GET['catid'];

$query_rsLinks = "SELECT tbl_links.linktitle, tbl_links.linkurl, tbl_links.linkdescr, tbl_categories.catname FROM tbl_links, tbl_categories WHERE tbl_links.linkcat=tbl_categories.catid AND tbl_links.linkapproved='y' AND tbl_links.linkcat = $categ ORDER BY tbl_links.linkdate ASC";

} else if (isset($_GET['keyword'])) {

$keyword = $_GET['keyword'];

$query_rsLinks = "SELECT tbl_links.linktitle, tbl_links.linkurl, tbl_links.linkdescr, tbl_categories.catname FROM tbl_links, tbl_categories WHERE tbl_links.linkcat=tbl_categories.catid AND tbl_links.linkapproved='y' AND (tbl_links.linkurl LIKE '%$keyword%' OR tbl_links.linktitle LIKE '%$keyword%' OR tbl_links.linkdescr LIKE '%$keyword%') ORDER BY tbl_links.linkdate ASC";

} else {

$query_rsLinks = "SELECT linktitle, linkurl, linkdescr, tbl_categories.catname FROM tbl_links, tbl_categories WHERE linkapproved = 'y' AND tbl_links.linkcat = tbl_categories.catid ORDER BY linkdate ASC";

}

and replace it with the following:

$query_rsLinks = "SELECT linktitle, linkurl, linkdescr, tbl_categories.catname FROM tbl_links, tbl_categories WHERE linkapproved = 'y' AND tbl_links.linkcat = tbl_categories.catid ORDER BY linkdate DESC";

Identify the line which reads:

<p id="title"><?php if (isset($categ) && $categ != "") { echo $row_rsLinks['catname']; } else { ?>Search result<?php } ?></p>

and replace it with:

<p id="title">Latest links</p>

And that′s it there is to it.
Our Latest links page is done.

In the next chapter I′ll explain how to create our last page - links_submit.php.

<<Display Search Result | Submit link page>>

 
  • Thank you for subscribing to our newsletter.
  • To complete registration please click on the link in the email which has been sent to you.
  • Invalid first name
  • Invalid last name
  • Invalid email address

Website Design Company | Website Design Company Sussex | Website Design Company Chichester | Website Design Packages | Tutorials Resources | Articles | Contact
© Web Design Tutorials – Sebastian Sulinski