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 3986612
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:02:07+00:00 2026-05-20T06:02:07+00:00

I am trying to build a HTML form if an item is in stock,

  • 0

I am trying to build a HTML form if an item is in stock, but as I’m storing the html in a string variable using single quotes to delimit it, and then setting form attributes using double quotes inside the form, how then can I refer to a php variable inside the form to dynamically assign a value to ‘addItem’. If you look at my code you’ll see what I mean! I will echo the contents of $summary after this has been done, and $summary at this point contains information extracted from my SQL database about the product.

$summary .= '<form id="testbasket" method="GET" target="_parent" action="cattest.php" >
        <input type="text" id="addItem" name="addItem" value='.'"<?php echo $plantname; ?>"'.'>
        <input type="submit" value="Add To Basket" />
        </form>';

Note: I’m using _parent as the target because this sits inside an iframe in the parent page.

Many thanks.

  • 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-20T06:02:08+00:00Added an answer on May 20, 2026 at 6:02 am
    $summary .= '<form id="testbasket" method="GET" target="_parent" action="cattest.php" >
            <input type="text" id="addItem" name="addItem" value="' . $plantname . '" />
            <input type="submit" value="Add To Basket" />
            </form>';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build a form using symfony2, but I keep getting the error
I'm trying to build a search form using Bootstrap. Here's the HTML: <form class=form-search
I'm trying to build a form using the Zend_Form component, but the number of
I am trying to build a form in HTML that, once submitted, automatically generates
I'm trying to build a simple HTML text editor in a Windows Form application.
I am trying to build a simple nested html menu using HAML and am
I'm trying to get title of simple html document to build sitemap. But always
I'm trying to build a form with nested attributes and in my view views/pedidos/new.html.erb
I am trying to build a query that uses checkboxes from an html form.
I am using Mongoid on Rails 3 and trying to build a nested form.

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.