Pages

Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

Sunday, March 4, 2012

Sams Teach Yourself PHP

Engineering books download,engineering books free download,engineering free books,download free engineering books,engineering books free free Download,free engineering book,engineering ebooks ,free engineering book download,free download of engineering books,engineering book download,engineering chemistry,download books for free,pdf books free,online books download,e books for free,books for free download
 

Sams Teach Yourself PHP
MySQL® and Apache All in One
Second Edition
By Julie C. Meloni
Table of Contents 

Part I: Laying the Groundwork

Chapter 1 Installing QuickStart Guide

Chapter 2 Installing and Configuring MySQL

Chapter 3 Installing and Configuring Apache

Chapter 4 Installing and Configuring PHP

Part II: PHP Language Structure

Chapter 5 The Building Blocks of PHP

Chapter 6 Flow Control Functions in PHP

Chapter 7 Working with Functions

Chapter 8 Working with Arrays and Objects

Part III: Getting Involved with the Code

Chapter 9 Working with Strings, Dates, and Times

Chapter 10 Working with Forms

Chapter 11 Working with Cookies and User Sessions

Chapter 12 Working with Files and Directories

Chapter 13 Working with the Server Environment

Chapter 14 Working with Images

Part IV: PHP and MySQL Integration

Chapter 15 Understanding the Database Design Process

Chapter 16 Learning Basic SQL Commands

Chapter 17 Interacting with MySQL Using PHP

Part V: Basic Projects

Chapter 18 Managing a Simple Mailing List

Chapter 19 Creating an Online Address Book

Chapter 20 Creating a Simple Discussion Forum

Chapter 21 Creating an Online Storefront

Chapter 22 Creating a Shopping Cart Mechanism

Chapter 23 Creating a Simple Calendar

Chapter 24 Restricting Access to Your Applications

Chapter 25 Logging and Monitoring Web Server Activity

Chapter 26 Application Localization

Part VI: Administration and Fine-Tuning

Chapter 27 Apache Performance Tuning and Virtual Hosting

Chapter 28 Setting Up a Secure Web Server

Chapter 29 Optimizing and Tuning MySQL

Chapter 30 Software Upgrades

Part VII: Looking Toward the Future

Chapter 31 Features and Backward Compatibility of PHP 5.0

Chapter 32 Features and Backward Compatibility of MySQL 4.1

Note: When you open MultiHost link below to MultiHost you can find 4 file hostingsites links in which you can download with your desired hosting site
Click Here To Download

reffred frm directdld

Friday, March 2, 2012

Core PHP Programming

Engineering books download,engineering books free download,engineering free books,download free engineering books,engineering books free free Download,free engineering book,engineering ebooks ,free engineering book download,free download of engineering books,engineering book download,engineering chemistry,download books for free,pdf books free,online books download,e books for free,books for free download
 

Core PHP Programming
Third Edition
By Leon Atkinson
Table of Contents 

Part I: Programming with PHP
Chapter 1 An Introduction to PHP
Chapter 2 Variables, Operators, and Expressions
Chapter 3 Control Statements
Chapter 4 Functions
Chapter 5 Arrays
Chapter 6 Classes and Objects
Chapter 7 I/O and Disk Access
Part II: Functional Reference
Chapter 8 Browser I/O
Chapter 9 Operating System
Chapter 10 Network I/O
Chapter 11 Data
Chapter 12 Encoding and Decoding
Chapter 13 Math
Chapter 14 Time and Date
Chapter 15 Configuration
Chapter 16 Images and Graphics>
Chapter 17 Database
Chapter 18 Object Layers
Chapter 19 Miscellaneous
Chapter 20 XML
Part III: Algorithms
Chapter 21 Sorting, Searching, and Random Numbers
Chapter 22 Parsing and String Evaluation
Chapter 23 Database Integration
Chapter 24 Networks
Chapter 25 Generating Graphics
Part IV: Software Engineering
Chapter 26 Integration with HTML
Chapter 27 Design
Chapter 28 Efficiency and Debugging
Chapter 29 Design Patterns
Part V: Appendix
Note: When you open MultiHost link below to MultiHost you can find 4 file hosting sites links in which you can download with your desired hosting site
Click Here To Download

reffred frm directdld

SAMS Teach Yourself PHP in 10 Minutes

Engineering books download,engineering books free download,engineering free books,download free engineering books,engineering books free free Download,free engineering book,engineering ebooks ,free engineering book download,free download of engineering books,engineering book download,engineering chemistry,download books for free,pdf books free,online books download,e books for free,books for free download
 

SAMS Teach Yourself PHP in 10 Minutes
By Chris Newman
Table of Contents 

Lesson 1.  Getting to Know PHP
   
Lesson 2.  Variables
   
Lesson 3.  Flow Control
   
Lesson 4.  Functions
  
Lesson 5.  Working with Numbers
Lesson 6.  Working with Strings
Lesson 7.  Working with Arrays
   
Lesson 8.  Regular Expressions
   
Lesson 9.  Working with Dates and Times
   
Lesson 10.  Using Classes
   
Lesson 11.  Processing HTML Forms
   
Lesson 12.  Generating Dynamic HTML
  
Lesson 13.  Form Validation
Lesson 14.  Cookies and Sessions
   
Lesson 15.  User Authentication
   
Lesson 16.  Communicating with the Web Server
   
Lesson 17.  Filesystem Access
Lesson 18.  Host Program Execution
Lesson 19.  Using a MySQL Database
   
Lesson 20.  Database Abstraction
   
Lesson 21.  Running PHP on the Command Line
   
Lesson 22.  Error Handling
   
Lesson 23.  PHP Configuration
   
Lesson 24.  PHP Security
Lesson 25.  Using PEAR
Note: When you open MultiHost link below to MultiHost you can find 4 file hosting sites links in which you can download with your desired hosting site
Click Here To Download

reffred frm directdld

Wednesday, May 18, 2011

Some PHP Snippets


HIGHLIGHT SPECIFIC WORDS IN A PHRASE

Sometimes, for example,
when displaying search results, it is a great idea to highlight
specific words. This is exactly what the following function can do:
1.function highlight($sString$aWords) {
2.    if (!is_array ($aWords) || empty ($aWords) || !is_string($sString)) {
3.        return false;
4.    }
5. 
6.    $sWords = implode ('|'$aWords);
7.    return preg_replace ('@\b('.$sWords.')\b@si''<strong style="background-color:yellow">$1</strong>'$sString);
8.}
Source: http://www.phpsnippets.info/highlights-words-in-a-phrase

GET YOUR AVERAGE FEEDBURNER SUBSCRIBERS

Recently,
Feedburner counts had lots of problems and it’s hard to say that the
provided info is still relevant. This code will grab your subscriber
count from the last 7 days and will return the average.
01.function get_average_readers($feed_id,$interval = 7){
02.    $today date('Y-m-d'strtotime("now"));
03.    $ago date('Y-m-d'strtotime("-".$interval." days"));
04.    $feed_url="https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=".$feed_id."&dates=".$ago.",".$today;
05.    $ch = curl_init();
06.    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
07.    curl_setopt($ch, CURLOPT_URL, $feed_url);
08.    $data = curl_exec($ch);
09.    curl_close($ch);
10.    $xml new SimpleXMLElement($data);
11.    $fb $xml->feed->entry['circulation'];
12. 
13.    $nb = 0;
14.    foreach($xml->feed->children() as $circ){
15.        $nb += $circ['circulation'];
16.    }
17. 
18.    return round($nb/$interval);
19.}
Source: http://www.catswhoblog.com/how-to-get-a-more-relevant-feedburner-count

AUTOMATIC PASSWORD CREATION

Although
I personally prefer leaving users to choose their password themselves,
a client recently asked me to generate passwords automatically when a
new account is created.
The following function is flexible: You can choose the desired length and strength for the password.
01.function generatePassword($length=9, $strength=0) {
02.    $vowels 'aeuy';
03.    $consonants 'bdghjmnpqrstvz';
04.    if ($strength >= 1) {
05.        $consonants .= 'BDGHJLMNPQRSTVWXZ';
06.    }
07.    if ($strength >= 2) {
08.        $vowels .= "AEUY";
09.    }
10.    if ($strength >= 4) {
11.        $consonants .= '23456789';
12.    }
13.    if ($strength >= 8 ) {
14.        $vowels .= '@#$%';
15.    }
16. 
17.    $password '';
18.    $alt = time() % 2;
19.    for ($i = 0; $i $length$i++) {
20.        if ($alt == 1) {
21.            $password .= $consonants[(rand() %strlen($consonants))];
22.            $alt = 0;
23.        else {
24.            $password .= $vowels[(rand() % strlen($vowels))];
25.            $alt = 1;
26.        }
27.    }
28.    return $password;
29.}
Source: http://www.phpsnippets.info/generate-a-password-in-php

COMPRESS MULTIPLE CSS FILES

If
you’re using different CSS files on your site, they might take quite
long to load. Using PHP, you can compress them into a single file with
no unnecessary white spaces or comments.
This snippet has been previously discussed on my “3 ways to compress CSS files using PHP” article.
01.header('Content-type: text/css');
02.ob_start("compress");
03.function compress($buffer) {
04.  /* remove comments */
05.  $buffer = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!'''$buffer);
06.  /* remove tabs, spaces, newlines, etc. */
07.  $buffer str_replace(array("\r\n""\r""\n""\t"'  ''    ','    '), ''$buffer);
08.  return $buffer;
09.}
10. 
11./* your css files */
12.include('master.css');
13.include('typography.css');
14.include('grid.css');
15.include('print.css');
16.include('handheld.css');
17. 
18.ob_end_flush();
Source: http://www.phpsnippets.info/compress-css-files-using-php

GET SHORT URLS FOR TWITTER

Are you on Twitter? If yes, you probably use a url shortener such as bit.ly or TinyUrl to share your favorite blog posts and links on the network.
This snippet take a url as a parameter and will return a short url.
1.function getTinyUrl($url) {
2.    return file_get_contents("http://tinyurl.com/api-create.php?url=".$url);
3.}
Source: http://www.phpsnippets.info/convert-url-to-tinyurl

CALCULATE AGE USING DATE OF BIRTH

Pass
a birth date to this function, and it will return the age of the
person; very useful when building communities or social media sites.
01.function age($date){
02.    $year_diff '';
03.    $time strtotime($date);
04.    if(FALSE === $time){
05.        return '';
06.    }
07. 
08.    $date date('Y-m-d'$time);
09.    list($year,$month,$day) = explode("-",$date);
10.    $year_diff date("Y") – $year;
11.    $month_diff date("m") – $month;
12.    $day_diff date("d") – $day;
13.    if ($day_diff < 0 || $month_diff < 0) $year_diff–;
14. 
15.    return $year_diff;
16.}
Source: John Karry on http://www.phpsnippets.info/calculate-age-of-a-person-using-date-of-birth

CALCULATE EXECUTION TIME

For
debugging purposes, it is a good thing to be able to calculate the
execution time of a script. This is exactly what this piece of code can
do.
01.//Create a variable for start time
02.$time_start = microtime(true);
03. 
04.// Place your PHP/HTML/JavaScript/CSS/Etc. Here
05. 
06.//Create a variable for end time
07.$time_end = microtime(true);
08.//Subtract the two times to get seconds
09.$time $time_end $time_start;
10. 
11.echo 'Script took '.$time.' seconds to execute';
Source: http://phpsnips.com/snippet.php?id=26

MAINTENANCE MODE WITH PHP

When
updating your site, it is generally a good thing to temporarily
redirect your users to a “Maintenance” page so they will not see any
critical info such as error messages.
This is generally done using an .htaccess file, but it can be done easily with PHP:
01.function maintenance($mode = FALSE){
02.    if($mode){
03.        if(basename($_SERVER['SCRIPT_FILENAME']) !='maintenance.php'){
04.            header("Location:http://example.com/maintenance.php");
05.            exit;
06.        }
07.    }else{
08.        if(basename($_SERVER['SCRIPT_FILENAME']) =='maintenance.php'){
09.            header("Location: http://example.com/");
10.            exit;
11.        }
12.    }
13.}
Source: http://www.phpsnippets.info/easy-maintenance-mode-with-php

PREVENT JS AND CSS FILES FROM BEING CACHED

By
default, external files such as javascript and css are cached by the
browser. If you want to prevent this from caching, simply use this easy
tip:
1.<link href="/stylesheet.css?<?php echo time(); ?>" rel="stylesheet"type="text/css" /&glt;
The result will look like this:
1.<link href="/stylesheet.css?1234567890" rel="stylesheet" type="text/css"/&glt;
Source: http://davidwalsh.name/prevent-cache

ADD (TH, ST, ND, RD, TH) TO THE END OF A NUMBER

Another useful snippet which will automatically add stndrd or th after a number.
01.function make_ranked($rank) {
02.    $last substr$rank, -1 );
03.    $seclast substr$rank, -2, -1 );
04.    if$last > 3 || $last == 0 ) $ext 'th';
05.    else if$last == 3 ) $ext 'rd';
06.    else if$last == 2 ) $ext 'nd';
07.    else $ext 'st';
08. 
09.    if$last == 1 && $seclast == 1) $ext 'th';
10.    if$last == 2 && $seclast == 1) $ext 'th';
11.    if$last == 3 && $seclast == 1) $ext 'th';
12. 
13.    return $rank.$ext;
14.}
Source: http://phpsnips.com/snippet.php?id=37