Jump to content

bcamp1973

Members
  • Posts

    133
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

bcamp1973's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Got it working! I guess it just took a good night's sleep and fresh eyes I just put the following in a file called getStream.php... set_time_limit(0); $fp = fsockopen("{$_GET['camera']}", 80, $errno, $errstr, 30); if(!$fp) { echo "/public/images/error.jpg"; } else { fputs($fp, "GET //nphMotionJpeg?Resolution=320x240&Quality=Standard HTTP/1.0\r\n\r\n"); while($str = trim(fgets($fp, 4096))) header($str); fpassthru($fp); fclose($fp); } and it's used like so... <img src="getStream.php?camera=office"/> and in my webserver's hosts file I set "office" to match with my cameras internal network IP address...I'm sure i'll bollocks something else up and be back with more questions
  2. I tried your solution and it just hangs on me. I don't think it likes the $content = file_get_contents($imageURL); line. Maybe the MJPEG screws it up? I did some more googling and came across the following link.... http://www.lavrsen.dk/twiki/bin/view/Motion/MjpegFrameGrabPHP As far as i can tell this is exactly what i'm trying to do (first example) but even their example isn't working for me. I know this has to be possible...unfortunately my knowledge of HTTP headers is nil!
  3. I'm using a few of the Panasonic "Pet cams". You can read more about them here... http://bit.ly/11VPeO ...just for a little background, this is a silly pet project of mine. I like the cameras and their features, but i HATE their web interface. I'm trying to bring the cameras together into a more integrated interface that works better on my wife and my phones. It's partly because I want them easier to use, and partly because I'm just having fun tinkering around. In the end none of this is truly "necessary" The cameras provide either motion JPEG images or MPEG-4. Regardless of what it's set to it's marked up in the cameras web server HTML like so... <input type="image" src="nphMotionJpeg?Resolution=320x240&Quality=Standard"> So, again, I need to get access to that stream from within my network. If it was a static image it probably wouldn't be a big issue, but not sure since it's a "stream"? ...oh, and the "b" in "rb" is supposedly to represent "binary"...or so my googling tells me, but you're right, i didn't see mention of it in the PHP manual either
  4. Ok, using @mjdamato's approach, i'm to the point where i can control the camera...hooray! ...now, i want to grab the motion JPEG that the camera returns using a similar method. Here's what i've stared with...which isn't working of course Hopefully this is possible?? header("Content-Type: image/jpeg\n"); fopen("http://192.168.1.112/nphMotionJpeg?Resolution=320x240&Quality=Standard","rb");
  5. @mjdamato, you are correct in your assumption...and thank you for doing a better job of describing it than I did I think your solution makes sense and will do what I'm looking for...I'll keep you posted
  6. @mjdamato, maybe you can dumb this down for me a little further? My impression is that if I'm at work hitting a website on home server (http://mydomain.com), any GET requests made from the website will have to be accessible from wherever I'm accessing the site. If my form's ACTION hits an internal IP (192.168.1.xxx) won't that submission error out outside the network?
  7. Thanks @roopurt18, however I'm getting "Class 'HttpRequest' not found in..." I take it this isn't something that's part of default PHP installs? I'm running PHP 5.3.0 on OS X...
  8. That was my initial thought, however, i'd like to just open up my web server and handle the requests within my network. Otherwise I have to open up the camera to the outside world as well. After i have this figured out i have 3 separate cameras that i'll be attempting to control and each of them would have to bet set up on their own port and accessible to anyone looking to mess with them
  9. I'm trying to control a few functions of my home IP camera via PHP. Commands for the camera are in the form of http://cameraIPaddress/cameraCGI?direction=panLeft ...I don't have to worry about capturing any kind of response etc. I simply want to send the command. I'd also like to authenticate the request, but no idea how to handle that from within the PHP? I've tried fsockopen(), but maybe i'm not doing it right...i worked from this example...it seems like it's overly complex for what i'm trying to do? $fp = fsockopen("www.example.com", 80, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)<br />\n"; } else { $out = "GET / HTTP/1.1\r\n"; $out .= "Host: www.example.com\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); while (!feof($fp)) { echo fgets($fp, 128); } fclose($fp); }
  10. wow, ok...i guess i thought i was breaking a whole bunch of rules with my approach. glad I'm not and, i would expect there will rarely be more than 30 to 40 items in a list that's being sorted except in very extreme cases...so, performance was probably never really an issue. just wanted to make sure I'm doing things "right" whenever i can or I'll never learn anything
  11. I have a grid view that allows the user to change the sort order of items (see attached screen shot). I have it working. However, my SQL skills are minimal at best and i fear I've made it far more complicated than it needs to be. Every time a user clicks on an arrow to change an items order I do ALL of the following (FYI $wpdb is a database class for wordpress). $currentorder is obviously the items current "item_order" and $neworder is either $currentorder+1 or $currentorder-1 depending on the direction it's being moved. $wpdb->query("UPDATE table_name SET item_order=9999 WHERE item_order=$currentorder); $wpdb->query("UPDATE table_nameSET item_order=$currentorder WHERE item_order=$neworder); $wpdb->query("UPDATE table_name SET item_order=$neworder WHERE item_order=9999); Of course, if any item is removed from the list, this potentially causes issues...so I then run this so the items are numbered 1-n... $items = $wpdb->get_col("SELECT id FROM table_name ORDER BY item_order ASC"); for($i=0; $i<count($items); $i++){ $wpdb->query("UPDATE table_name SET item_order=".($i+1)." WHERE id=".$items[$i]['id']); } I actually feel unclean after writing this...but I'm not sure how to do this "properly". Any suggestions?
  12. awesome! that works for one instance of %MATCH-XX%. how do i deal with multiple instances?
  13. i want to parse the page content looking for one or more instances of the string %MATCH-XX% where XX is an integer. I then want to replace that string with the code generated from a function that uses the XX integer as it's only argument. So, for example... i start with $content = '<p>This paragraph has a %MATCH-23% in it</p>'; and then my function function parse_match($XX,$content){ // work some magic with $content & $XX return '<span>with a number'.$XX.'</span>'; } produces this <p>This paragraph has a <span>with a number 23</span> in it</p> I need to be able to do this in PHP 4.1 as well...i'm at a loss at this point
  14. I have a new client with a small brick and mortar operation. They want to make the move online and upgrade their POS and inventory system and tie it in with a website CMS. I'm one person. I can round up another developer or two if needed. However, i'd like to use out of the box or OSS solutions where i can to minimize effort so i can focus primarliy on the UI and integration of the solutions. Have any of you had experience with such a task? If so what was your solution? Most of the OSS packages i'm finding are horrible...even the commercial offerings look pretty rough. I want a professional looking solution that won't require a complete facelift so I'm not embarrassed to implement it. I'll design the website UI, but i'd like the POS and admin tools to look like a designer had a say in it's layout I appreciate your thoughts on the matter!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.