www.webdeveloper.com
Results 1 to 3 of 3

Thread: how are dynamic links made

  1. #1
    Join Date
    Mar 2013
    Posts
    6

    how are dynamic links made

    hi again guys,
    just stuck again can u help me fix this .

    Code:
    <!DOCTYPE HTML>
    <html>
    <head>
    <meta charset=utf-8" />
    <style>
    .content{
    	   width:30%;
    	   height:500px;
    	   border-radius:15px;
           border:1px dashed #F00;
    	   float:left;
    }	   
    .sidebar{
    	   border-radius:15px;
           border:1px dashed #F00;
    	   
    	   width:20%;
    	   height:500px;
    	   float:left;
    	   }
    </style>
    </head>
    <body>
    
            <h4>
    		--------------------------------------------------------------------
    		                <a href="index.php?page=product1">PRODUCT-1</a> |
    		                <a href="index.php?page=product2">PRODUCT-2</a>----------------
    		</h4>
    
    		
    		<div class="sidebar">
    <center>
    		<h3>
    		 <a href="price.php">PRICE</a><br /><br />
    		 <a href="#">expiry</a><br /><br />
    		 <a href="#">location</a><br /><br />
    		</h3>
    		<center>
    		</div>
    		<div class="content">
    		     </div> 
    
    
    <body>
    </html>
    how do i show results based on what product has been clicked, the sidebar is supposed to display the result once the product is selected.

  2. #2
    Join Date
    Feb 2014
    Location
    Canada
    Posts
    155
    I'm guessing the users choose the products they want to view by clicking on the links in the <h4> element, then information is read from a database or file and displayed in the sidebar. The easiest way would be to use $_GET['page']. For example:

    PHP Code:
    // somewhere near the top
    $pageVal "";
    $productInfo ""// or array();
    if(isset($_GET['page'])) {
          
    $pageVal $_GET['page']
          
    $productInfo // connect to your database or file you're using to get product info
    } else {
          
    $pageVal "not set"// or write or do something else
    }
    // other content
    // in your sidebar assuming $productInfo is an array
    foreach($productInfo as $prodInfo) {
         
    // show the values for the product info

    I'm not quite sure why you want to show the values of your product as a hyperlink, unless the user is meant to further pick and choose something.

  3. #3
    Join Date
    Mar 2014
    Posts
    24
    With the help of PHP we can make the dynamic link.......................

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles