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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:34:55+00:00 2026-05-31T02:34:55+00:00

I build a table up of cameras using php. So upon entry I have

  • 0

I build a table up of cameras using php. So upon entry I have a query that pulls all the data I need (this is Joomla, hence the weird functions):

$query_camera_name = "SELECT camera_name, camera_status, camera_quality, email_notice, camera_hash, camera_type, camera_sensitivity, camera_user, camera_pass, camera_ip, camera_port FROM #__cameras WHERE user_id=".$user->id." AND camera_status!='DELETED'";
$db->setQuery($query_camera_name);
//get number of cameras so we can build the table accordingly
$db->query();
$num_rows = $db->getNumRows();
// We can use array names with loadAssocList.
$result_cameras = $db->loadAssocList();

I then look through to create a table with the data I need (this is abbreviated):

<?php
for($i=0;$i<$num_rows;$i++)
{
   ?>
...         
<tbody>
<tr data-hash="<?php echo $result_cameras[$i]["camera_hash"]; ?>">
<td>
    <?php echo $result_cameras[$i]["camera_type"]; ?>
</td>
<td>
    <?php echo $result_cameras[$i]["camera_name"]; ?>
</td>
...
<td>
   <button id="axis-details" onclick="apikey('<?php echo $result_cameras[$i]["camera_hash"]; ?>');">API Key</button>
</td>
...
<?php
}
?>

I’d like to create a jquery ui dialog with a textarea and a url filled in. The dialog is easy:

$(document).ready(function() {
var $dialog = $('<div></div>');
$dialog.append('Please copy this key for camera setup: ')
   .append('<p><textarea id=\"textbox\">'+ENTER URL HERE+'</textarea></p>') 
   .append('<p>For more information see: <a href=\"http://www.myhost.com/forum/2-quickstart-docs\">setup</a></p>');
$dialog.dialog({
  autoOpen: false,
  title: 'API Key'
});

$('#axis-details').click(function(e) {
  e.preventDefault();
  $dialog.dialog('open');
});

});

The url is this:

"http://myhost.com/notify.php/" +'<?php echo $result_cameras[$i]["camera_hash"]; ?>';

The problem is how can I put that url in the jquery code (where it says “ENTER URL HERE”)? I obviously can’t use:

<?php echo $result_cameras[$i]["camera_hash"]; ?>

because that is only resolved in the PHP code where I loop to build an html table. Any suggestions are appreciated.

  • 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-31T02:34:55+00:00Added an answer on May 31, 2026 at 2:34 am

    Foolowing will create dialog “on the fly”

    First you have to use class instead of ID for your “axis_details” button. ID’s must be unique in a page.

    You aready have url in your data-has attribute in TR

        $('.axis-details').click(function(e) {
            e.preventDefault();
            var url = $(this).closest('tr').data('hash');
    
            var $dialog = $('<div></div>');
            $dialog.append('Please copy this key for camera setup: ').append('<p><textarea id=\"textbox\">' + url + '</textarea></p>').append('<p>For more information see: <a href=\"http://www.myhost.com/forum/2-quickstart-docs\">setup</a></p>');
            $dialog.dialog({
    
                title: 'API Key',
                close: function() {
                    $(this).remove();
                }
            });
    
        })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to build an HTML table that shows data for users versus pages
I have a table that prints out all available cameras. It uses a form
I have an html table that pulls data from a DB. It has an
I have JSON data like this: [{id:3,name:jason},{id:4,name:karen}] I want to build a table view
I would need to build a html table that has a horizontally scrollable column.
I have two ajax functions that fetch JSON objects using .getJSON and then build
Automatically build mySql table upon a CSV file upload. I have a admin section
I've built a PHP AJAX pagination that works with an HTML Table. I have
I am trying to build a table using jQuery Datatables. Everything works on all
I have a table and I need to read a row and get all

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.