background preloader

Programming

Facebook Twitter

Facebook

The Oracle+PHP Cookbook | Creating an Ajax Process Using PHP and. EveryHit.com. ADOdb with PHP and Oracle. (c)2004-2005 John Lim. All rights reserved. 1. Introduction Oracle is the most popular commercial database used with PHP. There are many ways of accessing Oracle databases in PHP. These include: The oracle extension The oci8 extension PEAR DB library ADOdb library The wide range of choices is confusing to someone just starting with Oracle and PHP.

First we have the C extensions which provide low-level access to Oracle functionality. Here is an example of using the oci8 extension to query the emp table of the scott schema with bind parameters: $conn = OCILogon("scott","tiger", $tnsName); $stmt = OCIParse($conn,"select * from emp where empno > :emp order by empno"); $emp = 7900; OCIBindByName($stmt, ':emp', $emp); $ok = OCIExecute($stmt); while (OCIFetchInto($stmt,$arr)) { print_r($arr); echo "<hr>"; } This generates the following output: Array ( [0] => 7902 [1] => FORD [2] => ANALYST [3] => 7566 [4] => 03/DEC/81 [5] => 3000 [7] => 20 ) PEAR DB is good enough for simple web apps. ADOdb Example or. Zend Framework: Using Smarty as template engine || Dmytro Shtefl. Zend Framework’s View class has very bad capability for extending. It contains template variables but does not allow to access them, it has array with different pathes (templates, filters), but does not allow to add another type or access them.

Therefor only way to use Smarty with Zend Framework is to abandon Zend_View and manipulate Smarty object directly. First we need to create Smarty object. I do it in index.php after including Zend.php: I don’t like global variables therefor I’ve added Smarty object into Zend Framework’s registry: Using is pretty simple. As you can see Smarty integration with Zend Framework is very simple task. Comments are closed Comments for this entry are closed for a while. Php: The Holy Grail of PHP. Thought I'd share this with the community. I'll be writing a real walkthrough soon, as this combo is too good to keep to myself.Would love to hear any comments, criticisms, or alternatives.

If anyone is interested in helping write a few pages on the topic, send me an email or something too. What do you get when you combine an automated database object abstraction layer, an embedded templating engine, and an AJAX library? Unparalled rapid modular development fusing the web's hottest technologies.And it's easy. PEAR DB_DataObjectPHP Smartyxajax What's it look like? Index.php <? Ajax.php <? Template.php tpl/note.tpl <table><tr><td>{$note->name}</td></tr><tr><td>{$note->body}</td></tr></table> data.php schema.sql CREATE DATABASE organizer; USE organizer; CREATE TABLE notes ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, name VARCHAR(32), body TEXT, PRIMARY KEY(id) );

Utl_smtp attachment. All About Smarty - The PHP Template Engine [PHP &amp; MySQL News. Smarty is a PHP template engine written by Monte Ohrt and Andrei Zmievski. Yet another template engine you say? The authors (and I too) would disagree. Smarty is different from the rest of the pack. What differentiates Smarty from other template engines like FastTemplate and patTemplate is that Smarty compiles your templates into PHP scripts, eliminating the overhead incurred in parsing the templates every time they’re accessed.

The Smarty template engine has several other outstanding features besides template compilation, and we’ll discuss these a little later. Template Compilation Explained What does ‘compilation of templates’ mean, anyway? Smarty parses your templates and creates PHP scripts from them (instead of binaries, as in general programming). The good thing about this is that you don’t even have to know the PHP scripts are there, nor how compiling works. Caching Smarty also features built-in caching of your template outputs. Variable Modifiers Template Functions Filters Plug-ins. Mike Lopez Blogs » PHP Image Resize Script. So, you want to resize an image in PHP? PHP Image resizing has not been so easy especially to newbies so let’s make this as simple as possible.

All you have to do is save the script below to a file named ‘imgsize.php’ and give it a try. I use it myself on some of my projects and I wrote the script myself. Some usage examples are listed below after the script. Click here to . Save file as imgsize.php. [ads shoppingads computer] Usage examples: Resize an image to 25 x 25 Resize an image to 50% the size Resize an image to 50 pixels wide and autocompute the height Resize an image to 100 pixels tall and autocompute the width Resize to 50 pixels width OR 100 pixels tall, whichever resulting image is smaller Now enjoy yourself!

Questions, comments, suggestions? P.S. Random Image Rotation. One of the challenges facing the modern web designer is to create sites that appear fresh and new every time a visitor shows up. Article Continues Below It’s one thing if the site you’re designing is a news site, for example, where stories or headlines will be updated on a regular basis, providing fresh content on the hour — or even more frequently. But what about those of us designing sites for clients with relatively static pages whose content changes infrequently?

How can we provide fresh, changed content for our visitors on each subsequent visit, without relying on someone to generate this content on a daily or even hourly basis? Changing the page only slightly and in subtle ways can work miracles for an otherwise ‘static’ website. For example, imagine a masthead-graphic that’s different each time someone reloads the page. Many sites use this technique to randomize the images they display, including: Work Smarter#section1 There are a handful of scripts out there that rotate images. Mon.itor.us - FREE website monitoring. Here's what our monitoring tools can do for IT Consultants, ISPs, ISVs, Web Developers and Web Designers Imagine how much you could grow your business if you weren't chained to your desk.

Monitor.Us makes this possible. Because Monitor.Us is Cloud-based it not only lets you keep an eagle eye on everything, from anywhere; it also takes complex set-ups, installs, updates, reinstalls and server monitoring... and drops them from a very large height. So you can spend your time growing your business rather than simply managing it. After all, there is no faster or easier way to improve your revenue and expand your client list. And, here's what our monitoring tools can do for Sys Admins, DevOps, and IT Managers Monitor.Us system and all-in-one dashboard gives you such unrivalled insight that you can get a sense that something's wrong before it even happens.