Php - How do I correctly install PHPUnit with PEAR.
Tutorials. Regular Expression Quick Start. This quick start gets you up to speed quickly with regular expressions. Obviously, this brief introduction cannot explain everything there is to know about regular expressions. For detailed information, consult the regular expressions tutorial. Each topic in the quick start corresponds with a topic in the tutorial, so you can easily go back and forth between the two. Many applications and programming languages have their own implementation of regular expressions, often with slight and sometimes with significant differences from other implementations. When two applications use a different implementation of regular expressions, we say that they use different "regular expression flavors". This quick start explains the syntax supported by the most popular regular expression flavors. Text Patterns and Matches A regular expression, or regex for short, is a pattern describing a certain amount of text.
Literal Characters This regex can match the second a too. Learn more about literal characters q(? Gmail Email Relay using Postfix on Mac OS X 10.5 Leopard « Riverturn Blog. I use Postfix to relay system messages (e.g. a botched cronjob) over SSL to my Gmail account. These messages are otherwise “lost” because the email is being sent to a dormant mail transfer agent on my Mac. There’s way more that you can do with Postfix, but I’ll just cover the setup I did for my needs. 1. Create the Simple Authentication and Security Layer (SASL) password file. sudo vi /etc/postfix/sasl_passwd Enter and save the following smtp.gmail.com:587 your.name@gmail.com:your.password 2.
Sudo postmap /etc/postfix/sasl_passwd 3. Sudo vi /etc/postfix/main.cf By default, everything is commented out. . # Minimum Postfix-specific configurations. mydomain_fallback = localhost mail_owner = _postfix setgid_group = _postdrop relayhost=smtp.gmail.com:587 # Enable SASL authentication in the Postfix SMTP client. smtp_sasl_auth_enable=yes smtp_sasl_password_maps=hash:/etc/postfix/sasl_passwd smtp_sasl_security_options= # Enable Transport Layer Security (TLS), i.e. 5. Sudo postfix start sudo postfix reload.
Standard Configuration Examples. Purpose of this document This document presents a number of typical Postfix configurations. This document should be reviewed after you have followed the basic configuration steps as described in the BASIC_CONFIGURATION_README document. In particular, do not proceed here if you don't already have Postfix working for local mail submission and for local mail delivery. The first part of this document presents standard configurations that each solve one specific problem. The second part of this document presents additional configurations for hosts in specific environments. Postfix on a stand-alone Internet host Postfix should work out of the box without change on a stand-alone machine that has direct Internet access.
You can use the command "postconf -n" to find out what settings are overruled by your main.cf. /etc/postfix/main.cf: # Optional: send mail as user@domainname instead of user@hostname. Postfix on a null client A null client is a machine that can only send mail. Translation: Creating a simple PHP forum tutorial. PHP Tutorials MySQL Creating a simple PHP forum tutorial Learn to create forum step by step, in this tutorials use only simple php code but powerful. Overview In this tutorial, create 5 files 1. create_topic.php 2. add_topic.php 3. main_forum.php 4. view_topic.php 5. add_answer.php Steps 1.
If you don't know how to create database and table read this tutorial STEP1: Set up database Create database "test" and create 2 tables "forum_question" and table "forum_answer" Table forum_question CREATE TABLE `forum_question` ( `id` int(4) NOT NULL auto_increment, `topic` varchar(255) NOT NULL default '', `detail` longtext NOT NULL, `name` varchar(65) NOT NULL default '', `email` varchar(65) NOT NULL default '', `datetime` varchar(25) NOT NULL default '', `view` int(4) NOT NULL default '0', `reply` int(4) NOT NULL default '0', PRIMARY KEY (`id`) ) TYPE=MyISAM AUTO_INCREMENT=1 ; STEP2: Create file create_topic.php ############### Code STEP3: Create file add_topic.php <?
STEP4: Create file main_forum.php.
How to make a simple login system with PHP. So you’ve started learning PHP and want to learn how to create a login system? It’s much easier than you think. Using PHP Sessions, we can easily keep track of who’s logged in and redirect unauthorized users away from private pages. There are two pages I will be using for this example: A login page, and a protected page. The tutorial below is an extremely simply example that can help you get started with a basic authentication system. How can we track logged in Users? It is surprisingly very simple to track logged in users. Here’s how Sessions work: As you can see, sessions are pretty easy to use. Our login page shall have the following logic: While the protected will have the following: If you understand this basic logic, you can move to the next section. Setting up login.php Your login page will contain the login form as well as the PHP code which logs you in or keeps you logs out.
Here we go! That is the most basic form of a login page. The PHP code itself is pretty self explanatory.
Two submit buttons in the same form? PHP Server Side Scripting forum at WebmasterWorld. User groups. PHP Help: PHP Freaks! SDPHP | San Diego PHP Users. Libraries. CakePHP: the rapid development php framework. Home. Introduction to SPL. By Kevin Waterson Contents What is SPL. SPL provides a standard set of interfaces for PHP5. The aim of SPL is to implement some efficient data access interfaces and classes for PHP. Functionally it is designed to traverse aggregate structures (anything you want to loop over). This will provide you with a list something like this: What are iterators? An Iterator is an object that traverses a structure eg: an array or a directory listing or possibly a set of database result sets or other resource.
Apply Callback Function to Iterators As Iterators are read-only, a callback cannot act directly on iterator values. <? /*** an array of aussies ***/ $array = array( 'dingo' , 'wombat' , 'wallaby' ); try { $it = new ArrayIterator ( $array ); iterator_apply ( $it , 'addCaps' , array( $it ) ); } catch( Exception $e ) { /*** echo the error message ***/ echo $e -> getMessage (); } ? Note that the addCaps function returns bool true. Extending the DirectoryIterator class. } // end class ArrayObject <? <? <? <?
5 useful PHP functions for MySQL data fetching - AnyExample.com. Mysql_set_charset. I just hope that the text below will help someone who is struggling with charset encoding, specially when php-charset is different from the mysql-charset. Let me add that I really think that the php man-pages on the mysql-functions are lacking a lot of details on this important issues. Could someone add some useful text here? Here is my situation. PHP5.2.4, MySql 4.1.15. A php web-application fully utf-8 encoded and a mysql database in latin1 charset. To make this work I had to: 1. create and store all code files (php, html, inc, js, etc) in the utf-8 charset. 2. check that your editor does not add a BOM ( at the beginning of the file. 3. 4. 5. ======== all of the above sofar has nothing to do with mysql ;-) ====== 6. 7. 8 Finally test the above by storing this string in your db and output it in your webpage: 'Iñtërnâtiônàlizætiøn and €'.
Now what was interesting during testing and debugging of the above findings was: 1. 2. 3. 1. 2. 3.
Debug. Debugging PHP. Komodo can be used to debug PHP programs locally or remotely. Remote PHP debugging encompasses all types of PHP debugging not initiated from within Komodo, including debugging PHP scripts running under a local web server. The instructions below describe how to configure Komodo and PHP for debugging. For general information about using the Komodo debugger, see Komodo Debugger Functions. Debugger commands can be accessed from the Debug menu, by shortcut keys, or from the Debug Toolbar. Komodo uses a PHP debugger extension called Xdebug that must be installed for Komodo to debug PHP scripts. See www.xdebug.org/install.php for instructions on compiling Xdebug from source on other platforms.
Installing PHP PHP debugging in Komodo will work with PHP 4.3.11 or later, with the exception of versions 5.0.0 through 5.0.2. Refer to the PHP website for detailed information on installing PHP. Windows If you are unfamiliar with the installation of PHP, we recommend using the Windows InstallShield package.
PHP/MySQL. Soap. Resources I recomend. Hi, The topics of recommended books & websites comes up very often, so rather than bringing it up every other class posting once seems to make more sense. Just to be clear, these aren't things you need to buy for the course, just things that I have found useful myself while programming. Disclaimer #1 - I write for Wrox, an imprint of Wiley, I get many of their books for free. Actually, I got all the books recommended below for free but that's just a coincidence.
Full Disclosure - For the book links at Amazon I've used my associate ID. Recommended Websites: PHP - PHP's home. Other Information Sources PHP General Mailing List - I'd recomend signing up with a GMail account, the list is very helpfull but also very high traffic #PHP Chat Channel - There is no 'Official' chat channel for PHP, however I find the one on the Freenode IRC network very helpfull. Books Please reply to this list with your own recomendations.