Search found 323 matches

by Weiry
Thu Mar 19, 2015 5:47 pm
Forum: PHP - Security
Topic: VPS directories not to backup
Replies: 9
Views: 29651

Re: VPS directories not to backup

"There is no way to know what you have forgotten until you take the test" This is very much true, however it is much easier than you might think to test this :) If you ever feel that you need to test your backups to make sure that you have everything, i highly recommend using something li...
by Weiry
Wed Mar 18, 2015 5:54 pm
Forum: PHP - Security
Topic: VPS directories not to backup
Replies: 9
Views: 29651

Re: VPS directories not to backup

I would suggest that it comes down to how much you know about linux and how quickly you could re-deploy the OS that your systems are running on. If they provide you with a way to do your own snapshots and download them, that would probably be the easiest option. But it can really be as complex or as...
by Weiry
Sun Mar 15, 2015 7:46 pm
Forum: PHP - Security
Topic: Implications of a dynamic token
Replies: 0
Views: 16098

Implications of a dynamic token

This was mainly a proof of concept system as a way for exploring the possible ways of securing a form on a website without the form being inside a PHP file (so the form itself is in a plain .html file with no PHP executing). Note: Yes i do realise that inherently over non-ssl connections exposing a ...
by Weiry
Sun Dec 01, 2013 5:46 pm
Forum: PHP - Code
Topic: sessions destroyed instantly
Replies: 9
Views: 2013

Re: sessions destroyed instantly

I hate to need to ask the obvious question here. Does your php setup allow for PHP shorthand tags? I purposefully never work in PHP shorthand and have it disabled on my development environment. So i copied a very basic example of your code and added a quick html form and experienced the same issue w...
by Weiry
Sun Feb 17, 2013 5:25 pm
Forum: PHP - Code
Topic: Processing Multi-Dimensional array into existing object
Replies: 2
Views: 729

Re: Processing Multi-Dimensional array into existing object

Well i was able to solve the problem using a modified version of the original function i posted! function arrayToObject( $array ) { if ( !is_array( $array ) ) { return $array; } $object = new stdClass(); if ( is_array( $array ) && count( $array ) > 0 ) { foreach ( $array as $name => $value )...
by Weiry
Thu Feb 14, 2013 10:57 pm
Forum: PHP - Code
Topic: Processing Multi-Dimensional array into existing object
Replies: 2
Views: 729

Processing Multi-Dimensional array into existing object

Hi All, Have another interesting conundrum which involves JSON, arrays and objects. I am making use of a PHP library which helps to render JavaScript graphs. This library you can set a large number of settings for the graph itself by means of the following format: $chart->chart->renderTo = 'linechar...
by Weiry
Thu Feb 14, 2013 5:52 pm
Forum: PHP - Theory and Design
Topic: How to handle IF statements for every field in a table?
Replies: 7
Views: 13856

Re: How to handle IF statements for every field in a table?

I tend to agree with Christopher on this. I think that JSON would probably be one of the best approaches to achieving this as long as you have your database fields for referencing the information. You would probably have a separate class solely for the processing of that data (maybe even a static cl...
by Weiry
Mon Sep 17, 2012 7:15 pm
Forum: PHP - Code
Topic: Show external images - best/fastest way?
Replies: 7
Views: 1940

Re: Show external images - best/fastest way?

I have no idea what each camera has for speed/bandwidth. And i can't downloaded all the images to my server, every 10 seconds. This means that the server will have to work even more. :( That is generally how things works when you have a service which is constantly updating. At some point you have t...
by Weiry
Mon Sep 03, 2012 6:15 pm
Forum: PHP - Code
Topic: form with variable names, not static
Replies: 5
Views: 1330

Re: form with variable names, not static

I think this would come down to more array structure than anything else but you would have to be careful how it gets re-written to the page after validation. The other problem you will face is that you would need a way to determine what sort of field you are actually reading and as POST doesn't cont...
by Weiry
Sun Sep 02, 2012 9:56 pm
Forum: PHP - Code
Topic: Streamlining Code Inclusion Across Multiple Projects
Replies: 0
Views: 645

Streamlining Code Inclusion Across Multiple Projects

Hi All, I am not sure if this belongs under PHP Code or perhaps Theorycrafting? Here is the situation. There is a core set of classes which are usually included with most projects that are being worked on, primarily configuration and settings based classes and a couple of XML and socket type classes...
by Weiry
Wed May 09, 2012 7:40 am
Forum: PHP - Code
Topic: Double post problem
Replies: 12
Views: 1463

Re: Double post problem

The only effective way i can see of doing this is checking against a database entry to see if a mail was already sent before actually sending anything. The only problem here is that you have to: A) use a database B) store all the form's information so you can run checks against the database. Alterna...
by Weiry
Mon May 07, 2012 1:42 am
Forum: PHP - Code
Topic: [HINT] Better Exceptions!
Replies: 0
Views: 3142

[HINT] Better Exceptions!

I am not sure what sort of tag this really falls under, but this may be useful to those who are out using Exceptions. If you haven't done so during your OO programming, i would recommend using a custom Exception class. For the main reason, you can customise the __toString() so that you can output yo...
by Weiry
Fri May 04, 2012 8:46 am
Forum: PHP - Code
Topic: Method Scope and Multiple Classes
Replies: 10
Views: 1037

Re: Method Scope and Multiple Classes

Better to accept any IUPIConnector though, so tomorrow, if you have another implementation of IUPIConnector that needs to be wrapped to utilize DB access, instead of having another wrapper class, you can have Well i guess there are two points here, first that i know there wont be more than a single...
by Weiry
Thu May 03, 2012 10:53 pm
Forum: PHP - Code
Topic: Method Scope and Multiple Classes
Replies: 10
Views: 1037

Re: Method Scope and Multiple Classes

Well i think i may have come to a possible solution actually using a mix of ideas provided. require_once 'UPIConnectorDBWrapper.php'; $registry = new Settings(); $registry->dbsettings = array("db.database" => "chaf", "db.hostname" => "localhost", "db.user...
by Weiry
Thu May 03, 2012 6:53 am
Forum: PHP - Code
Topic: Worth learning PHP?
Replies: 2
Views: 1093

Re: Worth learning PHP?

PHP is worth knowing on the off chance that you happen to get stuck with some websites etc which employ the use of it. There are a lot of applications out there that use PHP and if you already know programming basics, PHP is pretty easy to skim over to learn as it follows (in my opinion at least) Ja...