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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:52:51+00:00 2026-06-12T02:52:51+00:00

I have a script which displays ads in a table based on a database

  • 0

I have a script which displays ads in a table based on a database query, each ad has a submit button, when the submit button is click it takes you to another page which echo’s the corresponding details based on the username of the ad you clicked on, however when there is more than one ad, it only displays the details of the first ad. Is there any way to assign a unique ID or something so that when the submit button of a specific ad is clicked the corresponding details are echo’ed rather than just the first one?

This is the echo code:

echo "<div id='expanderContent' style='display:none'>
        <div class='reasonbar'>
          <div class='prod-title1' style='width: 70%;'>" . 
            $row['lname'] . 
          "</div>
          <div class='reason1' style='width: 29%;'>
            Category:<br /> ". 
            $row['category'] . 
          "</div>
        </div>";

echo "<div class='reasonbar'>
        <div class='prod-title2' style='width: 70%;'>
          <form action='adclick.php' method='post'>
            <input type='hidden' name='username' value='" . $row['username'] . "'/>
            <input type='submit' name='submit' value='Submit'>
        </div>
        <div class='reason2' style='width: 29%;'>
        </div>
      </div
    </div>"; 
  • 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-12T02:52:52+00:00Added an answer on June 12, 2026 at 2:52 am

    First of all, you’re not closing your form tag in that echo. Second, do you have any kind of loop to go through multiple results (multiple ads) if more than one is retrieved?

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

Sidebar

Related Questions

i have a script which takes data from a database and displays it on
Here I have a simple php script which displays some values from a database
I have a table which displays some names and each row contains 3 cells.
I have table in database named ads, this table contains data about each ad.
I have found and customized this JQuery script, which displays different content when different
I have a script which allows to display favicon based on the url over
I have a script which allows to display favicons based on the url: Example
I have a script which allows to display search results. Given a query there
I have a script which validates each stage of a form and adds a
I have a following LOC in my ps1 script which displays a message with

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.