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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:41:36+00:00 2026-05-28T17:41:36+00:00

Sorry for this question. Basically I have a page where I have it automatically

  • 0

Sorry for this question.

Basically I have a page where I have it automatically sorting through categories etc and each block (img and 1 or 2 details) has a link (which takes to a Static Profile page). I also have a database created that with another page that is used to populate it.

Now I could create a page (html or php) for each but this is not what I want as I do not want 100 pages of the same thing/layout just different data and images.

I want to use the same layout on e.g. single.php – but populate it differently depending on which link the user clicked.

I seem to understand the logic I just dont understand how to do it. It’s obviously pulling the data from each database entry depending on the one clicked.

Very sorry to annoy you all as I am sure it is easy but I just can’t get my head around it.

Thanks for any help you can provide.

Example.

index.php <- which I have working fine. User can get to the desired link using filters (name, category, etc)

single.php <- I want this to be the 1 php page that is populated with different data depending on which link the user clicked. So no.1 is clicked and single.php displays the data for profile1, no.2 is clicked and single.php displays the data for profile2 etc.

The data I am referring to will be static text with 1 or 2 a href links (standard) and also some images.

I know it is meant to be something like this single.php?=somethinghere but I am not sure.

If anyone can help I would be very appreciative.

***EDITED BELOW***

So would I do the following then? As I am trying to pull the data from the database to populate the single.php page.

`if($_GET['link']=='companyname1'){
    //print company1 details on single.php page
    echo '<div>info on companyname1 from database</div>';
    echo '<otherdiv>other info on companyname1 from database</div>';

}elseif($_GET['link']=='companyname2'){
    //print company2 details on single.php page
    echo '<div>info on companyname2 from database</div>';
    echo '<otherdiv>other info on companyname1 from database</div>';

}else{
    //print main index
}`
  • 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-05-28T17:41:37+00:00Added an answer on May 28, 2026 at 5:41 pm

    make your links similar to this

    index.php?link=category
    

    then in the php

    if($_GET['link']=='category'){
        //print category page
    
    }elseif($_GET['link']=='name'){
        //print name page
    
    }else{
        //print main index
    }
    

    edit: here is a decent article. $_POST is the method you use when the variables are passed using a form. $_GET is whats used when people click links or type directly in the url bar.

    http://mrarrowhead.com/index.php?page=php_passing_variables.php

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

Sidebar

Related Questions

I'm sorry if this question is basic(I'm new to nosql). Basically I have a
Sorry if this question has been asked before. On my search through SO I
Sorry if this question is simple but I have been using node.js for only
Sorry if this question seems trivial to many here. In a C++ code there
Sorry if this question is too vague, but I'd rather not muddy it's point
Sorry if this question is very easy, but I can't find the answer anywhere.
Sorry since this question is specific to my problem. While learning reflections i did
sorry for this question, but i dont know where to search for it, or
Sorry if this question is somewhat subjective. I am new to 'could store', 'distributed
Sorry if this question will sound too chaotic, feel free to edit it. I

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.