Important Message from Foscam Digital Technologies Regarding US Sales & Service

Foscam.US (aka Foscam Digital Technologies and now Amcrest Technologies) is an independent United States based distributor of "Foscam" branded products. We have been offering telephone support, US local warranty and building the Foscam brand in the US for the past 7 years. Based on our experiences with Foscam and feedback from end users we have launched our own new and improved line of wireless IP cameras and security systems under the Amcrest brand. Working in partnership with the second largest security camera manufacturer in the world, Amcrest was founded with a deep commitment to end-user privacy and security, highly reliable software and hardware as well a seamless and intuitive user experience. For more information, please visit www.Amcrest.com

If you are having trouble with your Foscam cameras, we sincerely apologize for this inconvenience and would love to help. For technical support, response to inquiries and for obtaining replacements for any Foscam IP Cameras or NVR products, please reach out to tech@foscam.com or call 1-844-344-1113.

If you are interested in exchanging your Foscam camera for an Amcrest camera, we can offer you a massive loyalty discount, even if you are out of warranty. Please send an email to support@amcrest.com, sales@amcrest.com or call 1-888-212-7538

If you are subscribed to Foscam Cloud (www.foscamcloud.com), please contact cloud@foscam.us for support.

If you currently use the manufacturer's cloud service (www.myfoscam.com or linked in any way to www.foscam.com), you will need to contact them directly for support, at www.myfoscam.com.


Showing Secure Methods Using PHP To Display Your IP Cameras

General discussion regarding Foscam IP Cameras

Re: Showing Secure Methods Using PHP To Display Your IP Came

Postby TheUberOverLord » Wed Mar 12, 2014 4:27 pm

Minglarn wrote:First I personally want to thank you for this excellent piece of code as our IT at work wont let us to use ports (only port: 80) and this script let me bypass it.

Second, Is there a way with php programming to make the user enter a password to view the live feed?

Regards...

You are very welcome.

Yes. A new version was created 3.0 that now includes this. There are also live demonstrations showing using this logic as well:

http://foscam.us/forum/showing-secure-methods-using-php-to-display-your-ip-cameras-t8721.html#p42139

Don
TheUberOverLord
 
Posts: 13110
Joined: Fri Jun 22, 2012 11:52 pm

Re: Showing Secure Methods Using PHP To Display Your IP Came

Postby Minglarn » Sat Mar 15, 2014 10:06 am

Don, you are a genius. So easy, yet so powerful scripts. Thanks. Will implement this on my web page.

Again, thanks!
Minglarn
 
Posts: 313
Joined: Sat Jan 12, 2013 8:28 am

Re: Showing Secure Methods Using PHP To Display Your IP Came

Postby TheUberOverLord » Sat Mar 15, 2014 11:45 am

Minglarn wrote:Don, you are a genius. So easy, yet so powerful scripts. Thanks. Will implement this on my web page.

Again, thanks!

Thanks for the kind words.

Don
TheUberOverLord
 
Posts: 13110
Joined: Fri Jun 22, 2012 11:52 pm

Re: Showing Secure Methods Using PHP To Display Your IP Came

Postby jlopez006 » Mon Mar 17, 2014 9:12 pm

Hi Don,

I'm new user to the Foscam forum but I've gotten lots of good information and learned quite a bit from you and other users here. Thank you for all you do here. I do have a question regarding the this topic. I think I've followed your directions in getting this to work but for the life of me my IP cam feed just won't show. As I understand it, the SecureImageDisplay.htm file calls the SecureImageDisplay.php to display the cam feed. As long as the IP address, port, username and password are correct in the .php file it should load. Is this correct?

Thanks in advance,

J. Lopez
jlopez006
 
Posts: 2
Joined: Mon Mar 17, 2014 9:01 pm

Re: Showing Secure Methods Using PHP To Display Your IP Came

Postby TheUberOverLord » Mon Mar 17, 2014 9:43 pm

jlopez006 wrote:Hi Don,

I'm new user to the Foscam forum but I've gotten lots of good information and learned quite a bit from you and other users here. Thank you for all you do here. I do have a question regarding the this topic. I think I've followed your directions in getting this to work but for the life of me my IP cam feed just won't show. As I understand it, the SecureImageDisplay.htm file calls the SecureImageDisplay.php to display the cam feed. As long as the IP address, port, username and password are correct in the .php file it should load. Is this correct?

Thanks in advance,

J. Lopez

You are very welcome.

Yes. Did you follow the instructions located in SecureImageDisplay.php and make sure that the check was done using SecureImageDisplay.php using a browser window to make sure there are no errors found?

Code: Select all
http://YourDomain/SecureImageDisplay.php

If you don't do this and jump to using SecureImageDisplay.htm first. You may not see errors that you need to address first.

Don
TheUberOverLord
 
Posts: 13110
Joined: Fri Jun 22, 2012 11:52 pm

Re: Showing Secure Methods Using PHP To Display Your IP Came

Postby Minglarn » Fri Mar 21, 2014 7:37 am

Hi Don! Updated to v3 and works even better now.
But i have a question. Is it possible to let your login script create a log file where user and time stamp is added each time a user logs in or fails to log in?

It would be great to have this for security purposes.

Again, thanks for your effort to make our php/web n00bs much easier.

Regards.
Minglarn
 
Posts: 313
Joined: Sat Jan 12, 2013 8:28 am

Re: Showing Secure Methods Using PHP To Display Your IP Came

Postby TheUberOverLord » Fri Mar 21, 2014 10:33 am

Minglarn wrote:Hi Don! Updated to v3 and works even better now.
But i have a question. Is it possible to let your login script create a log file where user and time stamp is added each time a user logs in or fails to log in?

It would be great to have this for security purposes.

Again, thanks for your effort to make our php/web n00bs much easier.

Regards.

Thanks.

Your Web Server Access Logs will have IP Address/Refer date/time of access to SecureImageDisplayLogin.php.

My worry is that there are so many different ways to do something like a specific custom log. That it would not work for everyone as far as how long to keep data and so on. That it might be best to instead simply use your Web Server Access Log data.

There are many good tools that most Web Servers have. Such as LogWatch:

https://help.ubuntu.com/community/Logwatch

Many of these tools can send you emails when specific things are accessed on your Web Server as well as daily emails showing each access during that day.

Don
TheUberOverLord
 
Posts: 13110
Joined: Fri Jun 22, 2012 11:52 pm

Re: Showing Secure Methods Using PHP To Display Your IP Came

Postby Minglarn » Fri Mar 21, 2014 2:50 pm

I do understand that it will make things difficult. I was thinking if it is possible to let the php script do this by itself.

Is it even possible to let a php write to a single text file ?
Minglarn
 
Posts: 313
Joined: Sat Jan 12, 2013 8:28 am

Re: Showing Secure Methods Using PHP To Display Your IP Came

Postby TheUberOverLord » Fri Mar 21, 2014 4:39 pm

Minglarn wrote:I do understand that it will make things difficult. I was thinking if it is possible to let the php script do this by itself.

Is it even possible to let a php write to a single text file ?

Yes one could add custom log logic to any of the php files. But again that logic would be redundant because that same information should already be present and accessible from your Web Server Access log using other methods to get it vs. doing it all over again.

You can locate many php examples of creating/writing log files by doing searches on "php write log" as one example:

https://www.google.com/#q=php+write+log

IMHO. I still suggest using tools that can simply gather/report whatever access to this interface and its components take place from your Web Server access logs. Using tools like LogWatch or other tools.

I say this because some may want access information on who and when and from where accessed SecureImageDisplay.php, SecureImageDisplayLogin.php and SecureImageDisplay.htm

Once you create custom logs. You then may need to also create custom methods as to when to delete that data and many other things whereas by using the data already present in your Web Server access logs those log management issues are not required.

These are the major reasons that no custom logging is included in the Interface. Because it's redundant information already present on your Web Server and there are and would be some log management requirements that might not work for everyone in a generic way.

Don
TheUberOverLord
 
Posts: 13110
Joined: Fri Jun 22, 2012 11:52 pm

Re: Showing Secure Methods Using PHP To Display Your IP Came

Postby Minglarn » Fri Mar 21, 2014 4:51 pm

Great info Don! But, I still have issuies get access logs from my Synology NAS so I did a small add to your script..

I've put these lines to SecureImageDisplayLogin.php script:

Code: Select all
//Write to log, date and IP
$file = 'log.txt';
$ipaddress = $_SERVER["REMOTE_ADDR"];
$today = date("Y-m-d H:i:s") . "," . $_SERVER["REMOTE_ADDR"] . "\r\n";
$current = file_get_contents($file);
file_put_contents($file, $today, FILE_APPEND | LOCK_EX);


It works and logs date and IP to file "log.txt", a simple and fast addon to your script.

What do you think? Is it OK or should I add some more code or delete some?

Note: I really suck when it comes to PHP .. :oops:
Minglarn
 
Posts: 313
Joined: Sat Jan 12, 2013 8:28 am

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest