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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:58:08+00:00 2026-06-14T17:58:08+00:00

I have the following chunk of code: while ($row = mysql_fetch_array($result)) { echo <li/>.$row[‘trendName’].<input

  • 0

I have the following chunk of code:

while ($row = mysql_fetch_array($result)) {
    echo "<li/>".$row['trendName']."<input type='submit' name='Dispay' value='Display All Items'  onclick='action='http://blah.co.uk/DisplayData.php';'/>";
    echo"<br />";
}

So, this I want to do is for each element on the list to create a button. When I will click at this button I want to hit a URL.

Let’s say that we have only one element on the list (Movies). By clicking on the button next to the movies, I want to move to another URL: http://blah.co.uk/DisplayData.php
and furthermore to pass to the other URL the name of the element (i.e. Movies)

Is this possible, and if so, how?

  • 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-14T17:58:09+00:00Added an answer on June 14, 2026 at 5:58 pm

    I would also recommend to use <button></button> in html 5 to create a button.

    echo "<button type='submit' name='Display' onclick='javascript:location=\"http://blah.co.uk/DisplayData.php?value=$row['trendName']\"'>Display</button>";
    

    As suggested above, a link is the proper way to do so.

    <?php echo "<a href='http://blah.co.uk/DisplayData.php?value=".$row['trendName']."'>Display</a>"; ?>
    

    You can use $_GET['value']; to retrieve your data “trendName”

    However “action” is used in the <form></form> tag

    <form action='http://blah.co.uk/DisplayData.php'>
    <input type='hidden' name='value' value='<?php echo $row['trendName']; ?>' />
    <button type='submit'>Display</button>
    </form>
    

    here you would use $_POST['value']; to retrieve your data “trendName”

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

Sidebar

Related Questions

I have the following chunk of code. It works perfectly. <div id=restaurant_locations></div> <script type=text/javascript>
I came across the following weird chunk of code.Imagine you have the following typedef:
I am learning jQuery. I have the following chunk of code in an HTML
Having a major brain freeze, I have the following chunk of code: // Get
I have the following code (sorry for the large code chunk, but I could
I have a the following chunk of code that's adding up to six Player
I have the following chunk of header and footer code appearing in alot of
I have the following chunk of Python code (running v2.7) that results in MemoryError
I have the following chunk of HTML code but i cant figure how i
I have the following chunk of code in my footer.phtml <!-- Customer Modal -->

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.