Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7694917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:25:39+00:00 2026-05-31T21:25:39+00:00

I’m working on an e-commerce solution for one of my clients that will not

  • 0

I’m working on an e-commerce solution for one of my clients that will not involve any type of checkout functionality; but instead, the user will have the choice to submit a form that requests a quote. The user will also have the option to click on a product display, and then view a more detailed description about that product.

Here is a sample page that shows these options for each product:
http://dev.welcome2solutions.com/magnetfactory/store/products/category/awareness/

Although it’s not active at the moment, I created a custom page for when the user clicks “VIEW PRODUCT DETAILS” – it will show a simple image along with some detailed info about the product. I need the custom page to somehow populate the product details of the product that was selected by the user.

What is the best way to call the product details on the product details page so that it is auto-populated? Can I do this without having to “GET” the information through a form submission and posting it into the new page?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T21:25:40+00:00Added an answer on May 31, 2026 at 9:25 pm

    I need the custom page to somehow populate the product details of the product that was selected by the user

    It’s perfectly acceptable to build the URL to the product with the associated productId, so that you can call $_GET[‘id’] on the detail page. Once you have localized the productId on the detail page, you can issue a query to your products database to pull in the associated product data, via the productId. Obviously a better solution than attempting to pass in all product data via the url.

    Example:

    // Results page
    //  You can build links similar to the following
    //  This assumes you have a product object from which you can get id and name
    <a href="/product/detail/<?php echo $product->getId() ?>"><?php echo $product->getName() ?></a>
    
    // Detail page
    
    // Localize id
    $productId = $_REQUEST['id']; // I prefer to use $_REQUEST vs $_GET
    
    // Create our database object (dbo)
    $dsn = 'mysql:dbname=mydbname;host=127.0.0.1';
    $user = 'myusername';
    $pass = 'mypass';
    
    try {
        $dbo = new PDO($dsn, $user, $pass);
    } catch (Exception $e) {
        echo 'Unable to connect: ' . $e->getMessage();
    }
    
    // Construct your read query
    $sql = "SELECT * FROM my_product_table WHERE id = :productId";
    
    // Prepare query (avoids nasty things like sql injection by properly escaping 
    //  passed in parameters (:productId)
    $stmt = $dbo->prepare($sql);
    
    // Bind your local variable to the sql statement
    $stmt->bindValue(':productId', $productId, PDO::PARAM_INT);
    
    // Execute query
    $stmt->execute();
    
    // Localize query results (PDO::FETCH_OBJ will turn $product into a stdObject)
    $product = $stmt->fetch(PDO::FETCH_OBJECT);
    
    // Now you have access to the product data as it is stored in your database
    var_dump($product->name);
    var_dump($product->category); 
    ....
    

    I suggest you read up on PHP PDO (from which the above is based) for your database access. There are 100 ways to accomplish the same objective, but I think the above example should be enough to get you started in the right direction.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a function that will clean a strings' special characters. I do NOT
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am reading a book about Javascript and jQuery and using one of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.