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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:21:53+00:00 2026-06-05T14:21:53+00:00

Sorry for such an nOOb question, but I have been work on this for

  • 0

Sorry for such an nOOb question, but I have been work on this for a while now and can’t figure out how to break in and out of the php – specifically when it get to the do while loop below. Cna anyone help please?

if (!$_POST){
$display .= '<div class="aptitle">
            <h2>Add Product</h2>
          </div><!-- aptitle -->

          <div class="apsubtitle">
            <h3>Step 1 of 6</h3>
          </div><!-- apsubtitle -->

          <div class="selectcategorytitle">Please select a category for your item</div><!--selectcategorytitle-->
          <div class="selectcategory">
          <form action="addproducts2.php" method="post" enctype="multipart/form-data" name="step1">
             <div class="selected">Category: <select name="category" class="addproductselect" value=" ' . $selectedcategory . ' " id="select">
                <option value="0">Select a Category</option>
                <?php do { ?>

                <option value="<?php echo $categorylist['pk_cat_id'];?>">
                <?php echo $categorylist['category']; ?> </option>
                <?php } while ($categorylist = mysql_fetch_assoc($category_query)); ?>
             </select>
             <input name="submit" class="submitbtn" type="submit" value="Next Step" /></div><!--selected -->
          </form>

          </div><!--selectcategory-->';
}
  • 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-06-05T14:21:55+00:00Added an answer on June 5, 2026 at 2:21 pm

    You’re already in PHP when you’re putting the string into the variable. You don’t need more <?php tags, you just need a close quote and a ;.

    <?php
    if (!$_POST){
    $display .= '<div class="aptitle">
                    <h2>Add Product</h2>
                </div><!-- aptitle -->
    
                <div class="apsubtitle">
                    <h3>Step 1 of 6</h3>
                </div><!-- apsubtitle -->
    
                <div class="selectcategorytitle">Please select a category for your item</div><!--selectcategorytitle-->
                <div class="selectcategory">
                    <form action="addproducts2.php" method="post" enctype="multipart/form-data" name="step1">
                        <div class="selected">Category:
                            <select name="category" class="addproductselect" value=" ' . $selectedcategory . ' " id="select">
                                <option value="0">Select a Category</option>';
    
    do {
        $display .= '<option value="' . $categorylist['pk_cat_id'] . '">' . $categorylist['category']; . '</option>';
    } while ($categorylist = mysql_fetch_assoc($category_query));
    
    
    $display .= '</select>
    <input name="submit" class="submitbtn" type="submit" value="Next Step" /></div><!--selected -->
              </form>
    
              </div><!--selectcategory-->';
    }
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

sorry this is such a simple question but I can't figure it out. How
Sorry for asking such a beginner question but I can't figure this out. I
Sorry for such a basic question regarding lists, but do we have this feature
Sorry for such a vague question, but I have been searching around for the
Sorry to ask such a noob question, but the NDK documentation is wrong (r7b):
Sorry for such a trivial question, but I'd feel silly building this if it
Sorry for turning to here for such a basic question, but can someone just
Sorry for such a naive question, but can anyone explain to me the difference
Sorry this is such a long question. Ive been doing lots of research lately
I'm sorry for such a silly question, but I can not fathom the name

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.