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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:11:12+00:00 2026-06-13T00:11:12+00:00

I have made a website in which the users can select a value from

  • 0

I have made a website in which the users can select a value from a dropdown menu and get some information from a database. I used ajax to send the request to the database (so the page doesn’t get refreshed when I send the request). Here is the part of the jquery function:

      $.ajax({
      type:'POST',
      url:'activities_code.php',
      data: {datastr:datastr, datastr1:datastr1},
      success:function(response){

        $("#msg").html(response);                           
            }});}); // there are other functions before..

The results appear on the main container of the webpage. They are composed of a title and some text. I echo the title in such a way so it is a link. I also give to each element an id and a class so I can call it later. Here is the corresponding code:

    echo "<table id=\"container\">";
$num_results = 0;
while ($row=mysqli_fetch_array($result, MYSQLI_ASSOC)) {
     // Here the columns of title and information are printed
     echo "<tr><td>";
     echo "<a href='test.php' name=\"fd\" id=\"t".$t."\" target=\"_new\"  class='pickanchor' onClick=\"test()\">".$row['title']."</a>";
     echo "<br>";
     echo $row['PK'];
     echo "</td></tr>";

     echo "<tr><td>";
     echo $row['Information'];
     echo "</td></tr>"; 
 }

What I am trying to do now is: When I click on the title (which is a link), a new page to open in which a php script runs a query and show more information:
Here is what I have:

     <?php
     include('connect.php');


    $query = "SELECT title,Information from activities where title='?????'";

$result = mysqli_query($dbcon, $query) or die('no available data');
echo "<table>";
$num_results = 0;
while ($row=mysqli_fetch_array($result, MYSQLI_ASSOC)) {
     // Here the columns of title and information are printed
     echo "<tr><td>";
     echo "<a href='test.php' id=\"t\".$t target=\"_new\">".$row['title']."    </a>";
     echo "</td></tr>";

     echo "<tr><td>";

     echo $row['Information'];

     echo "</td></tr>";
    // Here I sum up the number of the results
     $num_results=$num_results+1;        
 }
     ?>

I am trying to find a way to put in my query, in the where clause, the name of the title that I selected:

     $query = "SELECT title,Information from activities where title='?????'";

Any help would be much appreciated. Let me know if everything is clear or I didn’t explain some point clearly.
Thanks.
D.

  • 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-13T00:11:13+00:00Added an answer on June 13, 2026 at 12:11 am

    You can get the title using $_GET global variable and URL parameter. Try changing this line:

    echo "<a href='test.php' name=\"fd\" id=\"t".$t."\" target=\"_new\"  class='pickanchor' onClick=\"test()\">".$row['title']."</a>";
    

    to

    echo "<a href='test.php?title={$row['title']}' name=\"fd\" id=\"t".$t."\" target=\"_new\"  class='pickanchor' onClick=\"test()\">".$row['title']."</a>";
    

    then you can get the title with these code:

    $title = $_GET['title'];
    

    make sure you sanitize the value first. I hope this will help you.

    link:

    PHP $_GET

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

Sidebar

Related Questions

I've made a website on which users can upload a video file. All is
I have made some screenshots of my website, and in internet explorer 6 my
I have made some screenshots of my website, and in internet explorer 6 my
I have a windows application which is published on a website and can be
I have made a website on which a user has to log in using
I have made a navbar at the top of my website which contains multiple
I had made a site for client in which users can make request for
I have made a website where, upon choosing an item in the menu bar,
I have made a website using( Asp.net, c# ) and its content in English
I have an engineering website made in Visual Studio / VB / .NET 4.0.

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.