div Click on different links to display the contents of different pages

Source: Internet
Author: User

What's important here is the idea that in a page, by clicking on a different link, the same area is displayed differently.

Method: In the div tag, depending on the click of the link when the different parameters, to load different pages

Example code explanation: to click upload Download file as an example

1. <div id= ' main ' >
<a href= "? act=" > Home </a>| | <a href= '? act=up ' > I want to upload </a>| | <a href= '? act=down ' > I want to download </a>
</div>
<div id= "Content" >
<?php
$act = $_get[' act '];
Switch ($act) {
Case ' up ':
Include ' upload.php ';
Break
Case ' upfile ';
Include ' upfile_chk.php ';
Break
Case ' down ';
Include ' downfile.php ';
Break
Case ' Downcode ';
Include ' downcode.php ';
Break
Case ' queryfile ';
Include ' queryfile.php ';
Break

Default
Include ' pub.php ';
Break
}
?>
</div>

The effect of the above code implementation is: When visiting the index.php, show the home page, I want to upload, I want to download the link, And below shows the content under the pub.php file (first visit is default), click I want to upload, in the following appear upload file domain, click I want to download, in the following display download navigation, click on the first page to display all the file list. A concrete example diagram:

Note: The above code functions can be normal implementation, if necessary, can leave a message request.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.