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

  • Home
  • SEARCH
  • 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 8870655
In Process

The Archive Base Latest Questions

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

I have 3 PHP files named as, index page books user Index Page <link

  • 0

I have 3 PHP files named as,

  1. index page
  2. books
  3. user

Index Page

<link href="colorbox.css" type="text/css" rel="stylesheet" media="all" />
<script type="text/javascript" src="jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="jquery.colorbox.js"></script>
<script type="text/javascript">
function bookRetr(str)
{
    if (str=="") {
        document.getElementById("more-info").innerHTML="";
        return;
    }

    // code for IE7+, Firefox, Chrome, Opera, Safari
    if (window.XMLHttpRequest) {
        xmlhttp=new XMLHttpRequest();
    } else {
        // code for IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }

    xmlhttp.onreadystatechange = function() {
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
            document.getElementById("more-info").innerHTML=xmlhttp.responseText;
        }
    }
    xmlhttp.open("GET","showbook.php?id="+str,true);
    xmlhttp.send();
}
</script>  
<script>
$(document).ready(function() {
    //Examples of how to assign the ColorBox event to elements
    $(".popup").colorbox({iframe:true, innerWidth:750, innerHeight:520});
});
</script>

<div id='$bookid' onClick="bookRetr(this.id)></div>
<div id='more-info'></div>

bookshow.php

$bookid = $_GET['id'];
$query  = mysql_query("SELECT * FROM bookdatabase WHERE ID='{$bookid}'");
$fetch  = mysql_fetch_array($query);
$user   = $fetch['userID'];

echo "<a href='showuser?id=$user' class='popup'>My name is X</a>";

The book show echo part is shown in my index page when i click on the div, but when click on My name is X, it open a new page but its actually supposed to open a popup. I got the popup named as colorbox plugin.

I’m unable to figure out where exactly i’m going wrong that the popup never opens.

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

    Instead of:

    $(".popup").colorbox({iframe:true, innerWidth:750, innerHeight:520});
    

    Try:

    $('.popup').live('click', function() {
      $.colorbox({href:$(this).attr('href'), open:true, iframe:true, innerWidth:750, innerHeight:520});
      return false;
    });
    

    OR if it won’t work:

    $("body").on("click", ".popup", function() {
      $.fn.colorbox({href:$(this).attr('href'), open:true, iframe:true, innerWidth:750, innerHeight:520});
      return false;
    });
    

    Hope it helps a little

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

Sidebar

Related Questions

I have 2 php files. index.php: <?php $counter = 0; require_once('temp.php'); temp(); echo $counter;
I have a page named index.html . On it, I have a menu with
I have a form like below on my index page: <form action=send.php method=POST> <b>Your
I have three files index.php login.php auth.php My login form is based on my
I have three files; index.php, searchbar.php and search.php now when i have search.php show
I have a php file that holds my login details named connect.php. $host =
I have this HTML: <form action='uploadhandle.php' method='POST' enctype=multipart/form-data> <input type='file' class='fileinput' id='photo1' name='photo1'> <input
I have several PHP files include()ing other files from several other directories. In one
I have some php files in a server which generate xml code in them.
I have various PHP files which data is Posted to (like the password when

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.