Jump to content

Search the Community

Showing results for tags 'product page'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. I have a crude eCommerce website i am building (the-jewelry-district.com/store) and i want to create a breadcrumbs script. here is my product.php page. im not sure if i need the script on my index.php as well. right now i have a simple echo of the categories and sub categories in the table from the database. 7 fields to be exact. Here they are as defined in the script below: $category = $row["category"]; $subcategory = $row["subcategory"]; $sub_subcategory_1 = $row["sub_subcategory_1"]; $sub_subcategory_2 = $row["sub_subcategory_2"]; $sub_subcategory_3 = $row["sub_subcategory_3"]; $sub_subcategory_4 = $row["sub_subcategory_4"]; $sub_subcategory_5 = $row["sub_subcategory_5"]; The problem is if the product only requires "category", "subcategoty" & "sub_subcategory_1" only then the end result is something like this: Category | Subcategory | Sub-Subcategory_1 | | | | | I use " | " as the heirachy separator so at the end, the echo still prints these. I based my site off of a 20 video ecommerce php & MySQL tutorial on youtube by a gentleman by the name of Adam Khoury in case you guys are wondering where I got this code from. Here is the entire product.php script I have. The while loop pretty much describes the table I use for my products. <?php include "storescripts/script_error_reporting.php"; /*Check to see the URL variable is set and that it exists in the database*/ if (isset($_GET['id'])) { // Connect to the MySQL database include "storescripts/connect_to_mysql.php"; $id = ($_GET["id"]); /*Use this var to check to see if this ID exists, if yes then get the product details, if no then exit this script and give message why*/ $sql = mysql_query("SELECT * FROM products WHERE id='$id' LIMIT 1"); $productCount = mysql_num_rows($sql); // count the output amount if ($productCount > 0) { /*get all the product details*/ while($row = mysql_fetch_array($sql)){ $product_name = $row["product_name"]; $browser_tab_title = $row["browser_tab_title"]; $url_name = $row["url_name"]; $price = $row["price"]; $details = $row["details"]; $category = $row["category"]; $subcategory = $row["subcategory"]; $sub_subcategory_1 = $row["sub_subcategory_1"]; $sub_subcategory_2 = $row["sub_subcategory_2"]; $sub_subcategory_3 = $row["sub_subcategory_3"]; $sub_subcategory_4 = $row["sub_subcategory_4"]; $sub_subcategory_5 = $row["sub_subcategory_5"]; $image_a = $row["image_a"]; $image_b = $row["image_b"]; $image_c = $row["image_c"]; $image_d = $row["image_d"]; $date_added = strftime("%b %d, %Y", strtotime($row["date_added"])); } } else { echo "That item does not exist."; exit(); } } else { echo "Data to render this page is missing."; exit(); } mysql_close(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR...nsitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><?php echo $browser_tab_title; ?></title> <link rel="stylesheet" href="style/style.css" type="text/css" media="screen" /> </head> <body> <?php include_once("template_header.php");?> <div id="breadcrumbs"> <p> <?php echo "$category | $subcategory | $sub_subcategory_1 | $sub_subcategory_2 | $sub_subcategory_3 | $sub_subcategory_4 | $sub_subcategory_5"; ?> <br /> </p> </div><!--breadcrumbs--> <!--PERMANENT ABOVE--> <div id="prodcont"> <div id="product"> <div id="productContent"> <div class="prodimgl"> <img src="inventory_images/<?php echo $image_a; ?>.jpg" width="300" height="300" > <img src="inventory_images/<?php echo $image_b; ?>.jpg" width="300" height="300" > <!--<img src="inventory_images/<?php echo $image_c; ?>.jpg" width="300" height="300" >--> <p>View Full Size Image</p> <a href="inventory_images/<?php echo $image_a; ?>.jpg" target="_blank">A</a> <a href="inventory_images/<?php echo $image_b; ?>.jpg" target="_blank">B</a> <!--<a href="inventory_images/<?php echo $image_c; ?>.jpg" target="_blank">C</a>--> </div><!--prodimg1--> <div class="proddesc"> <h1> <?php echo $product_name; ?> </h1> <div id="productDescription"> <?php echo $details; ?> <br /> <?php echo "$".$price; ?> <br /> <br /> <br /> </p> <form id="form1" name="form1" method="post" action="cart.php"> <input type="hidden" name="pid" id="pid" value="<?php echo $id; ?>" /> <input type="submit" name="button" id="button" value="Add to Shopping Cart" /> </form> </div><!--productDescription--> </div><!--proddesc--> </div><!--productContent--> </div><!--product--> </div><!--prodcont--> <?php include_once("template_footer.php");?> </body> </html>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.