0

I have this php based website, that displays a photo and draws data from a db to display on the page. Currently has a link to a live camera(viewed by internet browser) that opens in a separate page.

I have heard/read that using jquery you can create a iframe within your php page that you can link to another url(the camera for example) and display on the same page.

So in essence I could have my php page called displayPage load up and then inside that page I could section a 800x800 jquery frame that displays the live video feed with in.

Is this possible, I am restricted to using php as its the web server we run and it only needs to run in IE as we also use windows scripting on the page which relies on IE.

Looking at someone thing like this as eventually some of the data in the db will be taken from one location and stored by another team and the displayPage will not have access to the db just the web page that views it so would like to see if it will work with that also.

Is this possible?

Edited by mr_scooby: n/a

2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by mr_scooby
1

It is possible. With the use of ajax. Sure there are tons of tutorials out there. Don't need an iframe though, could just add it directly into a div. Eg.

$.get("includes/livefeed.php", {
    userid: $('#userID').attr('value'),
    type: "camconnect"
}, function(data){
    $("#livefeed").html(data);  
});

In the example above, we well send the userid to "livefeed.php" and process the data there, then return it to the "livefeed" div.

Edited by macneato: Typo Fix

0

OK, link jquery to your document; Then add this to your head

<script>
$(document).ready(function(){
 $("#feeds").load("http://172.xxx.xxx.xxx./live/single.asp");
}
</script>
<style>
#feeds {
width:800px;
height:800px;
overflow:hidden;
}
</style>
<table>
    <tr>
        <td>
            <img goes here>
        </td>
        <td>
        	<div id="feeds"></div>
        </td>
    </tr>
</table>

That should do the trick.

0

sweet as dude that fixed it mint, have only tried it on my home wamp server and found it works ok with linking to files in the same folder. Tried to link to a couple of websites eg google and gaming forum and it didn't work.

Will take it to work and try it on our server there.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.