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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:12:21+00:00 2026-05-28T02:12:21+00:00

I use a combination of html/php and javascript to open a new browser window

  • 0

I use a combination of html/php and javascript to open a new browser window that launches a flash app. This works fine, but most users these days don’t expect window popups and often forget to allow the popups. So I thought a good solution might be using Jquery’s dialog: http://jqueryui.com/demos/dialog/#default.

I’m looking for some guidance here on how to implement this with jquery dialog as this flash app needs many things passed into it. Hence the round about way of doing this.

I first create a button in html with a bunch of things pulled out of a DB:

<button id="monitor" onClick='startmonitor("<?php echo htmlentities($_SERVER['REQUEST_URI']); ?>","<?php echo $result_cameras[$i]["camera_hash"]; ?>","<?php echo $result_cameras[$i]["camera_name"]; ?>","<?php echo $camera_quality_flash; ?>")'>Monitor</button>

Then I create a form in javascript with the passed parameters from the button:

 function startmonitor(to, camerahash, cameraname, cameraflashquality)
 {
    var myForm = document.createElement("form");
    myForm.method = "post";
    myForm.action = to;

    var myInput = document.createElement("input");
    myInput.name="video";
    myInput.value="Monitor";
    myForm.appendChild(myInput);

    myInput = document.createElement("input");
    myInput.name="camera_hash";
    myInput.value=camerahash;
    myForm.appendChild(myInput);

    myInput = document.createElement("input");
    myInput.name="camera_name";
    myInput.value=cameraname;
    myForm.appendChild(myInput);

    myInput = document.createElement("input");
    myInput.name="camera_quality_flash";
    myInput.value=cameraflashquality;
    myForm.appendChild(myInput);

    document.body.appendChild(myForm);
    myForm.submit();
    document.body.removeChild(myForm);
 }

And finally process this in php further and call javascript to launch flash app:

if (isset($_POST['video'])) {
    //get user hash for monitor app
    $query_user_hash = "SELECT id_hash FROM #__users WHERE user_id=".$user->id;
    $db->setQuery($query_user_hash);
    $id_hash = $db->loadResult();

    $camera_hash = check_input($_POST['camera_hash']);
    $camera_name = check_input($_POST['camera_name']);
    $camera_quality_flash = check_input($_POST['camera_quality_flash']);

    echo '<script type="text/javascript">
        window.open("flashapp/app.php?user='.$id_hash.'&camera='.$camera_hash.'&name='.$camera_name.'&quality='.$camera_quality_flash.'", "Flash_monitor", "location=0,menubar=0,status=0,scrollbars=0,width=360,height=405")
    </script>';
}

Not even sure where to start from here. Do I try to use jquery dialog where I do the window.open? In which case I’m not sure how I pass the same parameters? Or is there a better way to tackle this.

  • 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-28T02:12:21+00:00Added an answer on May 28, 2026 at 2:12 am

    It seems the dynamic creation of a form and posting back to the server may be unnecessary. All seems it you are really doing is looking up the user’s id_hash. If you had that available on the main page you would not need the extra server side call. Then you could do something like this:

    <button id="monitor" onclick="startMonitor('<?php echo $result_cameras[$i]["camera_hash"]; ?>', '<?php echo $result_cameras[$i]["camera_name"]; ?>');">Monitor</button>
    

    and

    var startMonitor = function(cameraHash, cameraName) {
        var url = ['flashapp/app.php?user=<?php echo $user_id_hash; ?>', 'camera=' + cameraHash, 'name=' + cameraName, 'quality=<?php echo $camera_quality_flash; ?>'].join('&');
        $('<div></div>').load(url, function() {
            $(this).dialog();
        });
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for suggestions on Flash realtime servers. Currently, we use a combination of
I want to use a combination of this isset(empty($sc)) but am receiving this error
I have a workflow process that runs in weird combination of html and excel,
I'm trying to create a generalized HTML parser that works well on Blog Posts.
JavaScript application often use one of the following methods: They use empty HTML elements
I actually use a combination of OS X, Linux and Windows, but Windows is
Currently I use a single equation with different combination of known/unknown parameters. As I
I'm learning javascript. Poked around this excellent site to gather intel. Keep coming across
Premise I'd like to use HTML Purifier to transform <body> tags to <div> tags,
This is in reference to this (excellent) answer . He states that the best

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.