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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:45:39+00:00 2026-06-11T19:45:39+00:00

I have an area on my webpage that is populated by different <div> containers

  • 0

I have an area on my webpage that is populated by different <div> containers of information. When a link in my navigation bar is pressed, one <div> will fade out and another will fade in. What I’d like to do is have one of these content <div>‘s filled with dynamic information, and when a link is pressed on another one of the “pages” it would change which database to load the information from and then display, or fade in, that <div> with the new information.

Sudo:

<a href = "#" onClick = "changeContent('dynamicDiv'); [Set which database to load the information from]; "> View information </a>

<div id = "dynamicDiv">
<?php include 'file.php' ?>
</div>

file.php

**Find which database to load information from and display content**

I thought about using $GLOBAL vars, but I’m not sure how to set those from a link, and also it wouldn’t reload the div content.

I also considered using a form, but I’m not sure of the “correct” way of doing this would be, and also when the page is reloaded the <div> that is displayed by default would be loaded, not the <div id = "dynamicDiv>

Any suggestions/ideas are very much welcomed….

  • 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-11T19:45:40+00:00Added an answer on June 11, 2026 at 7:45 pm

    In this case you should use ajax.

    AJAX is used for changing the page content from server without reloading the page.

    You can use this JQUERY AJAX And JQUERY LOAD

    $(document).ready(function(){
    
    $("#changediv").load("load.php?id=1");
    
    })
    

    in load.php
    $id=$_GET[‘id’];

    // use that id for dynamic query in database
    $query="SELECT *.....";
    $result=mysql_query($query);
    echo mysql_fetch_array($result);//somthing like that
    

    All the word echoed in php become response in ajax.

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

Sidebar

Related Questions

I have a webpage that has one <div> with overflow-y:scroll; and for some reason
Heres a tricky one . . I have a webpage (called PageA) that has
I have a text area in a form that has a character limit and
i have one text area <textarea name=message id=message class=text_field style=height:200px; width:500px></textarea> if i type
I have a webpage that is a Search page. There are a few pre-defined
Does IE8 run in quirks mode like IE6/7? I have a webpage that has
I have a webpage that I would like to view when I am not
I have a text area in a django based website that displays the content
I have what I thought was a pretty simple area of my webpage, but
I currently have a gridview that is populated via database through a c# method.

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.