Jump to content

karpatzio

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Everything posted by karpatzio

  1. I decided to put my 3 months experience to the trial by creating a CMS app that will produce static output. I organized the app so a user registers/logins through a page, then the component (including a system component for system maintenance) is loaded and created running all the necessary steps such as outputting a config screen or processing forms. each of the components has its own users/permissions database/table to which you can get added/register through the components methods. am i going in a right way or are there more efficient routes to go at this?
  2. Programming a blog in oo would be nothing more than creating a simple model, fashioning a few classes, controllers and eventually they would all just fall into place to form the whole application, which would then be easier to maintain and follow. The procedural approach is like a full front assault, it might and usually does work, but sometimes the details and complexity can overwhelm you reducing your productivity. i guess this is less true to php as the applications tend to be smaller and spread across files anyway, but even here after you mess around with oo you will learn to appreciate it for larger scale applications.
  3. Recently i visited a blog powered by movable type and it seemed that all of the pages were cached yet they do update when contents change, and not only those certain pages but all of the other pages as well. How exactly is this done in Movable Type and other blog applications in general?
  4. I wrote a simple template class for educational purposes (im a total newbee to php and programming in general) thats based on an article i read, anyway unlike the article i added a member variable $template to store the parsed data instead of storing it in the body of the application. i doubt either way would have areal impact in a simple app using this class but still i was wondering why did the author chose to handle the data in the body for the sake of simplicity in a code meant to be delivered to the unexperienced such as me or if it is by principle more efficient/correct? the code: class mTemplate { private var $args; private var $fileRoot; private var $template; // Holds the template to be written /******************************************************************* Constructor *******************************************************************/ function __construct($templateDir = NULL) { $this->fileRoot = $templateDir; $this->args = array(); $this->template = ''; } /******************************************************************* Public Methods *******************************************************************/ public function setPath($fileRoot) { $this->fileRoot = $fileRoot; } public function setVars($var, $arg = NULL) { if(is_array($var)) { if($arg) { $this->args = $var; } else { $this->args = array_merge($this->args, $var); } } else { $this->arg['$var'] = $arg; } } public function returnParsed($file, $args = NULL) { if(is_array($args)) { extract($args); } else { extract($this->args); } ob_start(); include($this->fileRoot . $file); $contents = ob_get_contents(); ob_end_clean(); // Close buffer, dont send to client return $contents; } public function addParsed($file, $args = NULL) { if(is_array($args) { extract($args); } else { extract($this->args); } ob_start(); include($this->fileRoot . $file); $contents = ob_get_contents(); ob_end_clean(); // Close buffer, dont send to client $this->template .= $contents; } public function addUnparsed($bit) { if(file_exists($this->fileRoot . $bit)) { $this->template .= file_get_contents($this->fileRoot . $bit); } else { $this->template .= $bit; } } public function write() { echo $this->template; } public function get() { return $this->template; } public function delete() { $this->template = ''; } }
  5. lose money over javascript being turned off? definatly bad web application design, totally agree with daniel0
  6. i like the total feel of the site, but some graphics or perhaps more colors for the navboxes would improve the looks. the google ads seem a bit out of place but other than that good layout imo.
  7. i completly forgot to add, that the example assumes the ability of the user to name the objects in the images and in english (not everyone can know what the english word for pesto is, or know what pesto is at all). and there are a few more drawbacks but using images of widely known objects and simple icons with well formed questions the test would be easy enough for a human to answser and much more frustrating for a bot developer to solve.
  8. If you want to use a cognitive captcha then using text instead of images makes things alot easier for a malicious bot, you should use images and if possible varying images for each question. also the fact that there are multiple choices could be used, by just guessing the answer a bot could correct by a probability of 1/answers. so, a better approach would be to use images instead of a textual questcha. and to require the answer to be typed, instead of choosing from a given pool of answers. for example: |picture of a bird| | picture of an elephant| |picture of some pesto sauce| which of these would go best on pasta? *please type the answer in the text box below*
  9. i think this tool is pretty neat, would be neater if it used css styles!, though i think that if you needed a tool to generate forms then some WYSIWYG editor would be more appropriate. as for the php code, somehow copy pasting validation code i didnt generate with my own fingers and keyboard feels wrong... especially if i didnt have the know how needed to write the code myself in the first place.
×
×
  • 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.