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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:26:26+00:00 2026-06-06T02:26:26+00:00

i have this quick issue please. I have this code here which permits me

  • 0

i have this quick issue please.

I have this code here which permits me to extract a user name and a photo, and when the name is clicked it takes me to this hostess.php file, well, i need to pass the id variable to the hostess.php and save it, in order to get information only for that id..

Here is the code:

while ($row = mysql_fetch_array($query)) { 
echo "<div id='photo'>"; 
echo "<div id='picture'>"; 
 echo "<td> <img src=foto/photo1/".$row['photo'] . "></td>";
 echo "</div>"; 
 echo "<div id='text'>"; 
 echo '<td><a href="hostess.php">'. $row['first_name_en']."&nbsp;". $row['family_name_en']."</a></td>";
echo "</div>"; 
echo "</div>"; 
}

How can i just get the id and then how can i save it to the $id variable
Thanks

The table structure is like this:
The table name is called hostess and the field i need to retrieve from hostess is the [id]

  • 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-06T02:26:29+00:00Added an answer on June 6, 2026 at 2:26 am

    Change the line:

    echo '<td><a href="hostess.php">'. $row['first_name_en'] . 
         "&nbsp;". $row['family_name_en']."</a></td>";
    

    to this:

    echo '<td><a href="hostess.php?id={$row[id]}">'. $row['first_name_en'] . 
         "&nbsp;". $row['family_name_en']."</a></td>";
    

    and in hostess.php, use this to extract the value:

    $id = $_GET['id'];
    

    EDIT

    Here is another method to pass variable as POST. Again, change the aforementioned line to:

    echo '<td><form method="POST" action="hostess.php">' . "<input type='hidden' 
         name='id' value='{$row[id]}' />" . "<input type='submit' value='" . 
         $row['first_name_en'] . "&nbsp;" . $row['family_name_en'] . 
         " /></form></td>";
    

    You can use CSS to style that button as simple text too. And the value can be retrieved in hostess.php as follows:

    $id = $_POST['id'];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Quick question, What have I done wrong here. The purpose of this code is
I will make this quick and simple I have a query and I want
Really quick jQuery question... I have this function: $(document).ready(function() { $('a#show1').click(function() { $('.item1').toggle(1000); return
I am hoping that this will have a pretty quick and simple answer. I
This is just a quick question in C#. I have a scenario where I
Say I have a string: the quick brown fox jumped over the moon.this text
Quick question... I have a query that checks for duplicates that looks like this:
Quick question. I have an app that use a native DLL through PInvoke, this
Let's say I have a list of words, something like this: ['The', 'Quick', 'Brown',
Alright, here's a quick explanation of what I am doing: I have a website

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.