| PHP API | ||
|
php_check_syntax search codefetch
Check the PHP syntax of (and execute) the specified file
php_ini_scanned_files search codefetch
Return a list of .ini files parsed from the additional ini dir
php_logo_guid search codefetch
Gets the logo guid
php_sapi_name search codefetch
Returns the type of interface between web server and PHP
php_strip_whitespace search codefetch
Return source with stripped comments and whitespace
| ||
| Most relevant API matches shown. View All. | ||
| ||
1590595521/ch1/validstatements.php (5 lines) 1 <?php 2 $number = "5"; # $number is a string 3 $sum = 15 + $number; # Add an integer and string to produce integer 1590595521/ch10/basename.php (5 lines) 1 <?php 2 $path = "/home/www/data/users.txt"; 3 $filename = basename($path); // $filename contains "users.txt" 1590595521/ch10/dirname.php (4 lines) 1 <?php 2 $path = "/home/www/data/users.txt"; 3 $dirname = dirname($path); // $dirname contains "/home/www/data" 1590595521/ch10/disk_free_space.php (4 lines) 1 <?php 2 $drive = "/usr"; 3 echo round((disk_free_space($drive) / 1048576), 2); 1590595521/ch10/disk_total_space.php (9 lines) 1 <?php 2 $systempartitions = array("/", "/home","/usr", "/www"); 3 foreach ($systempartitions as $partition) { | ||
| ||
FdnPHPforDW8/examples/ch02/quirkstest.php (24 lines) 1 <?php session_start(); ?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3 <html xmlns="http://www.w3.org/1999/xhtml"> FdnPHPforDW8/examples/ch03/datetest.php (13 lines) 7 8 <body> 9 <?php 10 echo date('l, F jS, Y'); 11 ?> FdnPHPforDW8/examples/ch05/combined.php (18 lines) 6 </head> 7 <body> 8 <?php 9 $tweedledee = "'The time has come,' the Walrus said,\n"; 10 $tweedledee .= "'To talk of many things:\n"; FdnPHPforDW8/examples/ch05/concatenated.php (18 lines) 6 </head> 7 <body> 8 <?php 9 $tweedledee = "'The time has come,' the Walrus said,\n"; 10 $tweedledee = $tweedledee."'To talk of many things:\n"; FdnPHPforDW8/examples/ch05/quotes.php (15 lines) 7 8 <body> 9 <?php 10 $year = date('Y'); 11 echo 'Single quotes: The year is $year<br />'; | ||
| ||
phphacks/adredirector/index.php (16 lines) 1 <?php 2 function redir_link( $url, $text ) 3 { 4 ?> 5 <a href="redir.php?url=<?php echo( $url ); ?>"><?php echo( $text ); ?></a> 6 <?php 7 } 8 ?> phphacks/adredirector/redir.php (27 lines) 1 <?php 2 srand(time()); 3 if ( mt_rand(0,10) < 7 ) phphacks/amazon/index.php (121 lines) 1 <?php 2 require_once 'PEAR.php'; 3 require_once 'Services/Amazon.php'; 4 5 $devtoken = "0T3VDGN1DDDN1EAA1S02"; phphacks/awss/index.php (95 lines) 1 <?php $states = array( 2 array( "Alabama",4447100,1963711,52419.02,1675.01,50744,87.6,38.7 ), 3 array( "Alaska",626932,260978,663267.26,91316,571951.26,1.1,0.5 ), phphacks/boxes/BOX1TEST.PHP (16 lines) 1 <html> 2 <head> 3 <? include( "box1.php" ); 4 add_box_styles(); 5 ?> | ||
| ||
ch01-strings/check.inc.php (26 lines) 1 <?php 2 function checkNotEmpty($s) { 3 return (trim($s) !== ''); ch01-strings/check.php (9 lines) 1 <?php 2 require_once 'check.inc.php'; 3 var_dump(checkNotEmpty(" \r\n ")); 4 var_dump(checkNotEmpty('.')); ch01-strings/checksum.php (19 lines) 1 <?php 2 $pass = (isset($_GET['pass'])) ? $_GET['pass'] : ''; 3 ch01-strings/compare.php (6 lines) 1 <?php 2 $a = 'PHP'; 3 $b = 'php'; 4 echo 'strcmp(): ' . strcmp($a, $b) . '<br />'; 5 echo 'strcasecmp(): ' . strcasecmp($a, $b); ch01-strings/comparelogin.php (14 lines) 1 <?php 2 $user = (isset($_GET['user'])) ? $_GET['user'] : ''; 3 $pass = (isset($_GET['pass'])) ? $_GET['pass'] : ''; | ||
| ||
CHAPTER03/backupDatabase.php (60 lines) 1 #!/usr/local/bin/php 2 <?php 3 4 // configuration CHAPTER03/pullFrom.php (68 lines) 1 #!/usr/local/bin/php 2 <?php 3 4 // configuration 5 $rsync = '/usr/bin/rsync --rsh=ssh -aCvz --delete-after'; 6 $username = NULL; // default username 7 8 // construct usage reminder notice 9 ob_start(); 10 ?> 11 pullFrom.php 12 Fetches (in place) an updated mirror from a remote host. 13 CHAPTER03/resetPermissions.php (95 lines) 1 #!/usr/local/bin/php 2 <?php 3 4 // (sample) presets CHAPTER06/integrity.php (183 lines) 1 #!/usr/local/bin/php 2 <?php 3 4 // simple file class to track detailed file metrics including hash and stats CHAPTER06/mcrypt.php (127 lines) 1 <?php 2 3 class mcrypt { | ||
| ||
ch01/echo.php (25 lines) 10 Echoing some text: 11 </H1> 12 <?php 13 echo "Hello from PHP."; 14 ?> 15 <H1> 16 Echoing some more text: 17 </H1> 18 <?php 19 echo "Hello from PHP again!"; 20 ?> 21 <BR> 22 <BR> 23 <IMG SRC="php-power-white.gif"> 24 </BODY> 25 </HTML> ch01/phpconstants.php (20 lines) 2 <HEAD> 3 <TITLE> 4 Using PHP constants 5 </TITLE> 6 </HEAD> 7 8 <BODY> 9 <H1> 10 Using PHP constants 11 </H1> 12 <?php 13 define ("pi", 3.1415926535); 14 ch01/phphere.php (23 lines) 10 Displaying here Documents 11 </H1> 12 <?php 13 echo <<<END 14 This example uses 15 "here document" syntax to display all 16 the text until the ending token is reached. 17 END; 18 ?> 19 <BR> 20 <BR> 21 <IMG SRC="php-power-white.gif"> 22 </BODY> 23 </HTML> ch01/phphtml.php (17 lines) 2 <HEAD> 3 <TITLE> 4 Mixing HTML and PHP! 5 </TITLE> 6 </HEAD> 7 8 <BODY> 9 <H1> 10 Mixing HTML and PHP! 11 </H1> 12 <?php 13 phpinfo(); 14 ?> 15 <IMG SRC="php-power-white.gif"> 16 </BODY> 17 </HTML> ch01/phpinterpolation.php (26 lines) 10 Interpolating variables 11 </H1> 12 <?php 13 echo "Setting number of apples to 1.<BR>"; 14 | ||
| ||
php files/Ch11/checkdate.php (24 lines) 1 <?php 2 if (isset($_POST['theDate'])) { 3 // split the date into component parts php files/Ch11/current_timestamps.php (15 lines) 8 <body> 9 <table> 10 <tr><td><strong>mktime(): </strong></td><td><?php echo mktime(); ?></td></tr> 11 <tr><td><strong>gmmktime(): </strong></td><td><?php echo gmmktime(); ?></td></tr> 12 <tr><td><strong>Difference: </strong></td><td><?php echo gmmktime()-mktime(); ?></td></tr> 13 </table> 14 </body> php files/Ch11/date_formats.php (26 lines) 1 <?php 2 // following line for use in Windows 3 setlocale(LC_TIME, 'frc'); php files/Ch11/july4.php (13 lines) 7 8 <body> 9 <?php $jul4 = mktime(0,0,0,7,4,2005); 10 echo date('l, jS F Y', $jul4); 11 ?> php files/Ch11/strtotime.php (15 lines) 7 8 <body> 9 <?php 10 $xmas = strtotime('25 Dec 2005'); 11 $twelvedays = strtotime('+ 12 days', $xmas); | ||
| ||
Appedix A Example Files/ch03ex01.php (20 lines) 1 <html><head><title>My Title</title></head> 2 <body> 3 <?php 4 if (isset($_POST[posted])) { 5 echo "Thanks. Your first name is $_POST[first_name] and your last name is $_POST[last_name]"; 6 } else { 7 ?> 8 <h2>Please fill out this form</h2> 9 <form method="POST" action="<?php $PHP_SELF ?>"> 10 <input type="hidden" name="posted" value="true"> 11 First Name<input type="text" name="first_name"><br> Appedix A Example Files/ch04ex01.php (418 lines) 6 7 <body bgcolor="#FFFFFF"> 8 <form method="POST" action="ch04ex01.php"> 9 <?php 10 if (isset($_POST[pre_qualify])) { 11 Appedix A Example Files/ch05ex01.php (93 lines) 7 <body bgcolor="#FFFFFF"> 8 9 <?php 10 11 if (isset($_POST[posted])) { Appedix A Example Files/ch06ex01.php (259 lines) 6 7 <body bgcolor="#FFFFFF"> 8 <?php 9 10 //create the function to write the HTML tags Appedix A Example Files/ch07ex01.php (86 lines) 6 7 <body bgcolor="#FFFFFF"> 8 <?php 9 10 if (isset($_POST[posted])) { 11 12 //get the folder to search for 13 $folder_to_find = $_POST[folder_name]; 14 15 //set the default directory 16 $default_dir = array(realpath("/Inetpub/wwwroot/beginning_php5/appendix_a/")); 17 18 //create an array to hold any matches | ||
| ||
final-code/03/listing03.01.php (13 lines) 1 <?php 2 class ShopProduct { 3 // class body final-code/03/listing03.02.php (14 lines) 1 <?php 2 class ShopProduct { 3 public $title = "default product"; final-code/03/listing03.03.php (18 lines) 1 <?php 2 class ShopProduct { 3 public $title = "default product"; final-code/03/listing03.04.php (22 lines) 1 <?php 2 class ShopProduct { 3 public $title = "default product"; final-code/03/listing03.05.php (24 lines) 1 <?php 2 class ShopProduct { 3 public $title; | ||
| ||
ProPHP5CodeSeparations/ch01/class.Cat.php (26 lines) 1 <?php 2 3 class Cat { ProPHP5CodeSeparations/ch01/class.Cheetah.php (11 lines) 1 <?php 2 require_once('class.Cat.php'); 3 4 class Cheetah extends Cat { ProPHP5CodeSeparations/ch01/class.Customer.php (23 lines) 1 <?php 2 3 class Customer { ProPHP5CodeSeparations/ch01/class.Demo.php (11 lines) 1 <?php 2 3 class Demo { ProPHP5CodeSeparations/ch01/class.Door.php (31 lines) 1 <?php 2 3 require_once('interface.Openable.php'); 4 5 class Door implements Openable { | ||
| ||
06/examples/mysqli_bind1.php (26 lines) 1 <?php 2 3 $conn = mysqli_connect("localhost", "test", "", "test"); 06/examples/mysqli_bind2.php (13 lines) 1 <?php 2 3 $conn = mysqli_connect("localhost", "test", "", "test"); 06/examples/mysqli_blob1.php (22 lines) 1 <?php 2 3 $conn = mysqli_connect("localhost", "test", "", "test"); 06/examples/mysqli_blob2.php (30 lines) 1 <?php 2 3 $conn = mysqli_connect("localhost", "test", "", "test"); 4 5 if (empty($_GET['id'])) { 6 $result = $conn->query("SELECT id, length(data) FROM files LIMIT 20"); 7 if ($result->num_rows == 0) { 8 print "No images!\n"; 9 print "<a href=\"mysqli_blob1.php\">Click here to add one</a>\n"; 10 exit; 11 } 12 while ($row = $result->fetch_row()) { 13 print "<a href=\"$_SERVER[PHP_SELF]?id=$row[0]\">"; 14 print "image $row[0] ($row[1] bytes)</a><br />\n"; 15 } 06/examples/mysqli_buffered1.php (32 lines) 1 <?php 2 3 $conn = mysqli_connect("localhost", "test", "", "world"); | ||
| ||
book/Chapter 11/database-connection.php (13 lines) 1 <?php 2 // Database Connection Script 3 book/Chapter 11/database-insert.php (14 lines) 1 <?php 2 // Data insertion script 3 include('database-connection.php'); 4 for($i = 0; $i <= 50; $i++){ 5 if($i % 2) { book/Chapter 11/database-test.php (10 lines) 1 <?php 2 // Data test script 3 include('database-connection.php'); 4 5 $sql = mysql_query("SELECT * FROM my_table"); | ||
| ||
chapter10/backticks.php (4 lines) 1 <?php 2 $result = `date`; 3 echo "<p>The server timestamp is: $result</p>"; chapter10/basename.php (5 lines) 1 <?php 2 $path = "/home/www/data/users.txt"; 3 $filename = basename($path); // $filename contains "users.txt" chapter10/dirname.php (4 lines) 1 <?php 2 $path = "/home/www/data/users.txt"; 3 $dirname = dirname($path); // $dirname contains "/home/www/data" chapter10/diskfreespace.php (4 lines) 1 <?php 2 $drive = "/usr"; 3 echo round((disk_free_space($drive) / 1048576), 2); chapter10/disktotalspace.php (8 lines) 1 <?php 2 $systempartitions = array("/", "/home","/usr", "/www"); 3 foreach ($systempartitions as $partition) { | ||
| ||
wda/appf/example.f-9.php (31 lines) 1 <?php 2 require_once "HTML/Template/ITX.php"; 3 require "mysql_sessions.inc"; 4 wda/apph/example.h-1.php (36 lines) 9 <body> 10 <pre> 11 <?php 12 // (1) Open the database connection 13 $connection = mysql_connect("localhost","fred","shhh"); wda/apph/example.h-2.php (36 lines) 9 <body> 10 <pre> 11 <?php 12 // (1) Open the database connection 13 $connection = mysqli_connect("localhost","fred","shhh"); wda/ch02/example.2-1.php (16 lines) 9 <body bgcolor="#ffffff"> 10 <h1> 11 <?php 12 print "Hello, world"; 13 ?> wda/ch02/example.2-2.php (12 lines) 1 <?php $outputString = "Hello, world"; ?> 2 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 3 "http://www.w3.org/TR/html401/loose.dtd"> 4 <html> 5 <head> 6 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 7 <title><?php print $outputString; ?></title> 8 </head> 9 <body bgcolor="#ffffff"> 10 <h1><?php print $outputString; ?></h1> 11 </body> 12 </html> | ||
| ||
allinone_form.php (78 lines) 7 <? 8 $form_block =" 9 <FORM METHOD=\"POST\" ACTION=\"$_SERVER[PHP_SELF]\"> 10 11 <P><strong>Your Name:</strong><br> comments.php (21 lines) 9 <? 10 11 // This is a simple PHP comment. 12 13 /* This is a C-style, multi-line comment. You can make this as constants2.php (9 lines) 4 echo "<br>This is line number ".__LINE__; 5 6 echo "<br>I am using ".PHP_VERSION; 7 8 echo "<br>This test is being run on ".PHP_OS; 9 ?> contact_menu_ch18.php (79 lines) 32 //build form block 33 $form_block ="<h1>Login</h1> 34 <form method=POST action=\"$_SERVER[PHP_SELF]\"> 35 36 $msg contact_menu_ch22.php (128 lines) 33 <h1>Login</h1> 34 35 <form method=POST action=\"$_SERVER[PHP_SELF]\"> 36 $msg 37 | ||
| ||
1590592808-1/Chapter01/ex1.php (25 lines) 1 <?php 2 // Load the DB code 3 require 'DB.php'; 4 5 // Connect to the database 1590592808-1/Chapter02/ex01.php (25 lines) 1 // Load the ADODB code 2 require 'adodb/adodb.inc.php'; 3 4 // Connect to the database 5 $conn = &ADONewConnection('mysql'); 6 $conn->connect('localhost','phpgems','phpgems1','phpgems'); 7 8 // Send a SELECT query to the database 1590592808-1/Chapter02/ex09.php (5 lines) 1 require 'adodb/rsfilter.inc.php'; 2 setlocale(LC_MONETARY,'en_US'); 3 $rs = $conn->Execute('SELECT flavor,calories,price FROM ice_cream'); 1590592808-1/Chapter02/ex12.php (3 lines) 1 require 'adodb/adodb-errorhandler.inc.php'; 2 // ... establish connection to the database ...… 3 $rs = $conn->execute('SELECT flavor,calories,price FROM cookies'); 1590592808-1/Chapter02/ex14.php (7 lines) 1 require 'adodb/adodb-errorpear.inc.php'; 2 // ... establish a connection to the database ... 3 $rs = $conn->execute('SELECT flavor,calories,price FROM cookies'); | ||
| ||
ws/10-1.php (28 lines) 1 <?php 2 // 3 // Chapter 10, pg 246 ws/10-10.php (45 lines) 1 <?php 2 // 3 // Chapter 10, pg 269 ws/10-13.php (50 lines) 1 <?php 2 // 3 // Chapter 10, pg. 275 ws/10-14.php (48 lines) 1 <?php 2 // 3 // Chapter 10. pg 278 ws/10-2.php (35 lines) 1 <?php 2 // 3 // Chapter 10, pg 248 4 // 5 $file = $_SERVER['PHP_SELF']; 6 $cachefile = "$file.cache"; 7 | ||
| ||
LearningPHP5Code/AppendixA/example-A-01.php (1 lines) 1 <?php print "PHP enabled"; ?> LearningPHP5Code/AppendixA/example-A-02.php (6 lines) 1 require 'DB.php'; 2 if (class_exists('DB')) { 3 print "ok"; LearningPHP5Code/AppendixA/example-A-03.php (1 lines) 1 <?php phpinfo(); ?> LearningPHP5Code/AppendixA/example-A-04.php (23 lines) 1 ; How to specify directories on Unix: forward slash for a separator 2 ; and a colon between the directory names 3 include_path = ".:/usr/local/lib/php/includes" 4 5 ; How to specify directories on Windows: backslash for a separator 6 ; and a semicolon between the directory names 7 ; Windows: "\path1;\path2" 8 include_path = ".;c:\php\includes" 9 10 ; Report all errors but notices and coding standards violations LearningPHP5Code/AppendixA/example-A-05.php (23 lines) 1 ; How to specify directories on Unix: forward slash for a separator 2 ; and a colon between the directory names 3 php_value include_path ".:/usr/local/lib/php/includes" 4 5 ; How to specify directories on Windows: backslash for a separator 6 ; and a semicolon between the directory names 7 ; Windows: "\path1;\path2" 8 php_value include_path ".;c:\php\includes" 9 10 ; Report all errors but notices and coding standards violations 11 php_value error_reporting "E_ALL & ~E_STRICT" 12 13 ; Record errors in the error log 14 php_flag log_errors On 15 16 ; Don't automatically create variables from form data 17 php_flag register_globals Off 18 19 ; An uploaded file can't be more than 2 megabytes 20 php_value upload_max_filesize 2M 21 22 ; Sessions expire after 1440 seconds 23 php_value session.gc_maxlifetime 1440 | ||
| ||
corephp/1-10.php (24 lines) 1 <?php 2 $Today = date("l F d, Y"); 3 ?> 4 <html> 5 <head> 6 <title>Listing 1-10</title> 7 </head> 8 <body> 9 Today's date: 10 <?php 11 /* 12 ** print today's date corephp/1-11.php (23 lines) 5 <body> 6 <h1> 7 <?php 8 /* 9 ** Get today's day of the week corephp/1-12.php (18 lines) 6 <h1>Today's Daily Affirmation</h1> 7 Repeat three times:<br> 8 <?php 9 for($count = 1; $count <= 3; $count++) 10 { corephp/1-6.php (8 lines) 4 </head> 5 <body> 6 Today's date: <?php print(Date("l F d, Y")); ?> 7 </body> 8 </html> corephp/1-7.php (14 lines) 5 <body> 6 Today's date: 7 <?php 8 /* 9 ** print today's date | ||
| ||
tunein/html/cart.php (237 lines) 1 <?php 2 require_once "../includes/top.inc"; 3 ?> tunein/html/ccform.php (331 lines) 1 <?php 2 if( !isset($HTTP_POST_VARS) 3 || 4 ( $HTTP_REFERER != $PHP_SELF && strpos($HTTP_REFERER,"checkout.php") === FALSE ) 5 ) 6 { 7 die("<p>You appear to have reached this page in error.</p> 8 <p>Please <a href=\"index.php\">click here</a> to go to our Home Page.</p>"); 9 } 10 tunein/html/checkout.php (435 lines) 1 <?php 2 require_once "../includes/top.inc"; 3 tunein/html/checkout1.php (219 lines) 1 <?php 2 require_once "../includes/top.inc"; 3 ?> tunein/html/checkout2.php (292 lines) 1 <?php 2 require_once "../includes/top.inc"; 3 ?> | ||
| ||
DVD Life/_lib/_base/config.php (54 lines) 1 <?php 2 3 // File Location: /_lib/_base/config.php 4 5 /** DVD Life/_lib/_base/elements.php (226 lines) 1 <?php 2 3 // File Location: /_lib/_base/elements.php 4 5 /** DVD Life/_lib/_base/funcs.php (68 lines) 1 <?php 2 3 // File Location: /_lib/_base/funcs.php 4 5 /** DVD Life/_lib/_base/handlers.php (99 lines) 1 <?php 2 3 // File Location: /_lib/_base/handlers.php 4 5 /** DVD Life/_lib/_bin/hourly.newsletter.php (29 lines) 1 #!/usr/bin/php 2 <?php 3 4 /* COPYRIGHT NOTICE 5 This software is copyright ©2002 Code Is Artô and licensed for use by distribution from Code Is Artô only. 6 This source code may not be redistibuted without written consent from the above mentioned entity. */ 7 8 ini_set("include_path", ini_get("include_path").":/var/www/html/_lib/_base/:/var/www/html/_lib/_classes/:/var/www/html/site/:/var/www/html/core/"); 9 10 require_once("class.newsletter.php"); 11 12 $oNewsletter = new newsletter; | ||
| ||
ch-5,6,7/Ch05/3d/chiseling.php (64 lines) 1 <? 2 3 include("3dlib.php"); 4 5 $imagein=imagecreatefrompng("squarecirc.png"); ch-5,6,7/Ch05/3d/graph.php (45 lines) 1 <? 2 3 include("3dlib.php"); 4 5 $im=imagecreatefrompng("example24.png"); ch-5,6,7/Ch05/3d/phongterms.php (86 lines) 7 <br/> 8 <br/> 9 <?php 10 11 include "../shadows/shadow.php"; 12 MakeShadowFile("sign.png", "99%", 15, 15, 15, "50%", "sign_shadow.png"); 13 14 include("3dlib.php"); 15 16 $imagein=imagecreatefrompng("sign.png"); ch-5,6,7/Ch05/3d/smoothing.php (60 lines) 1 <? 2 3 include("3dlib.php"); 4 5 $imagein=imagecreatefrompng("smooth.png"); ch-5,6,7/Ch05/3d/texture.php (64 lines) 1 <? 2 3 include("3dlib.php"); 4 5 // Create text "3D!" and a pill-like thingy | ||
| ||
Documents and Settings/matthewma/My Documents/phpdwmx/error/errorhandler.php (51 lines) 1 <?php 2 // Tell PHP to use our function named errorHandler, to handle future errors 3 set_error_handler("errorHandler"); 4 ?> 5 <?php 6 // This is the error handler function that PHP calls in the event of an error 7 function errorHandler($errorCode, $errorDescription, $filename, $linenumber, $extraVars){ 8 $email = "webmaster@website.com"; Documents and Settings/matthewma/My Documents/phpdwmx/error/pagewitherror.php (5 lines) 1 <?php require_once($DOCUMENT_ROOT . 'errorhandler.php'); ?> 2 3 <?php 4 trigger_error("This is a test Error Message",E_USER_ERROR); 5 ?> Documents and Settings/matthewma/My Documents/phpdwmx/graphics/buttons.php (46 lines) 1 <html> 2 <body> 3 <?php 4 5 function generateToolbarButton($text, $filename) { Documents and Settings/matthewma/My Documents/phpdwmx/graphics/counterimg.php (14 lines) 1 <?php 2 3 header('Content-Type: image/png'); Documents and Settings/matthewma/My Documents/phpdwmx/graphics/gdcounter.php (23 lines) 1 <?php 2 3 session_start(); | ||
| ||
PHPBible_2ndEd/ch01/greeting.php (23 lines) 4 <BODY> 5 <P>Hello, 6 <?php 7 // We have now escaped into PHP mode. 8 // Instead of static variables, the next three lines 9 // could easily be database calls or even cookies; PHPBible_2ndEd/ch02/techbizbook.php (41 lines) 2 <HEAD> 3 <TITLE>TechBizBookGuide example from server</TITLE> 4 <?php include_once("tbbg-style.css"); ?> 5 <?php include_once("javascript.inc"); ?> 6 </HEAD> 7 <BODY> 8 <?php 9 include_once("tbbg-navbar.txt"); 10 $org = $_GET['org']; 11 ?> 12 <TD BGCOLOR="#FFFFFF" ALIGN=LEFT VALIGN=TOP WIDTH=83%> 13 <TABLE CELLPADDING=5 WIDTH=100%><TR><TD ALIGN=LEFT VALIGN=MIDDLE> 14 <H2>Books about <?php print("$org"); //passed in from URL ?></H2><BR></TD></TR> 15 <TR><TD WIDTH=50% ALIGN=LEFT> 16 <?php 17 $dbh = mysql_connect('localhost', 'mysqluser') or die("Unable to open database"); 18 mysql_select_db("techbizbookguide") or die("Unable to access database"); PHPBible_2ndEd/ch04/helloworld.php (12 lines) 1 <HTML> 2 <HEAD> 3 <TITLE>My first PHP program</TITLE> 4 </HEAD> 5 6 <BODY> 7 <?php 8 print("Hello, cruel world<BR><BR>\n"); 9 phpinfo(); 10 ?> 11 </BODY> PHPBible_2ndEd/ch06/listing6_1.php (32 lines) 1 <?php 2 $type_examples[0] = 123; // an integer 3 $type_examples[1] = 3.14159; // a double PHPBible_2ndEd/ch06/maxint.php (17 lines) 1 <?php 2 function maxint() 3 { /* quick-and-dirty function for PHP int size -- 4 assumes largest integer is of form 2^n - 1 */ 5 $to_test = 2; | ||
| ||
customer_receipt.php (87 lines) 7 in derived source files. 8 The citation should list that the code comes from Hugh E. 9 Williams and David Lane, "Web Database Application with PHP and MySQL" 10 published by O'Reilly & Associates. 11 This code is under copyright and cannot be included in any other book, 12 publication, or educational product without permission from O'Reilly & 13 Associates. 14 No warranty is attached; we cannot take responsibility for errors or fitness 15 for use. 16 */ 17 ?> 18 <?php 19 include 'error.inc'; 20 include 'db.inc'; example.2-1.php (32 lines) 7 in derived source files. 8 The citation should list that the code comes from Hugh E. 9 Williams and David Lane, "Web Database Application with PHP and MySQL" 10 published by O'Reilly & Associates. 11 This code is under copyright and cannot be included in any other book, example.2-2.php (29 lines) 7 in derived source files. 8 The citation should list that the code comes from Hugh E. 9 Williams and David Lane, "Web Database Application with PHP and MySQL" 10 published by O'Reilly & Associates. 11 This code is under copyright and cannot be included in any other book, 12 publication, or educational product without permission from O'Reilly & 13 Associates. 14 No warranty is attached; we cannot take responsibility for errors or fitness 15 for use. 16 */ 17 ?> 18 <?php $outputString = "Hello, world"; ?> 19 <!DOCTYPE HTML PUBLIC 20 "-//W3C//DTD HTML 4.0 Transitional//EN" example.2-3.php (52 lines) 7 in derived source files. 8 The citation should list that the code comes from Hugh E. 9 Williams and David Lane, "Web Database Application with PHP and MySQL" 10 published by O'Reilly & Associates. 11 This code is under copyright and cannot be included in any other book, example.2-4.php (56 lines) 7 in derived source files. 8 The citation should list that the code comes from Hugh E. 9 Williams and David Lane, "Web Database Application with PHP and MySQL" 10 published by O'Reilly & Associates. 11 This code is under copyright and cannot be included in any other book, | ||
| ||
progphp-examples/ch01/1-1.php (8 lines) 4 </head> 5 <body> 6 <?php echo 'Hello,world!'?> 7 </body> 8 </html> progphp-examples/ch01/1-2.php (2 lines) 1 <?php phpinfo();?> progphp-examples/ch01/1-3.php (19 lines) 5 <body> 6 7 <?php 8 if (!empty($_POST['name'])) { 9 echo "Greetings,{$_POST['name']},and welcome."; 10 } 11 ?> 12 13 <form action="<?php $PHP_SELF;?>" method="post"> 14 Enter your name: <input type="text" name="name"/> 15 <input type="submit"/> progphp-examples/ch01/1-4.php (32 lines) 3 <table border=1> 4 <tr><th>Movie</th><th>Year</th><th>Actor</th></tr> 5 <?php 6 //connect 7 require_once('DB.php'); 8 $db =DB::connect("mysql://username:password@server/webdb"); 9 if (DB::iserror($db)) { progphp-examples/ch01/1-5.php (30 lines) 1 <?php 2 if (isset($_GET['message'])) { 3 // load font and image,calculate width of text | ||
| ||
1/script_01_01.php (80 lines) 6 </head> 7 <body> 8 <?php # script_01_01.php 9 define ("W", $w); 10 function write_data ($v, $k, $fp) { 1/script_01_02.php (117 lines) 6 </head> 7 <body> 8 <?php 9 10 define ("WEEK", $week); 1/script_01_03.php (150 lines) 1 <?php # script_01_03.php 2 // ***************************** 3 // Online Football Picks System 4 5 // Developed by: Larry E. Ullman 6 7 // Written: August 2001 8 // Modified: August 14, 2001 9 10 // Contact: php@DMCinsights.com 11 12 // The process_winners.php page handles the pick_winners.php page. It determines how each player did and stores this information in a text file. 13 14 // ***************************** 1/script_01_05.php (52 lines) 6 </head> 7 <body> 8 <?php # make_picks_form.php 9 10 $file = '2001/week' . $week . '.txt'; // Identify the file based upon which week it is. 11 12 if ($games = @file ($file)) { // Read the file into an array. 13 14 // If it read the file, print the form. 15 echo '<form action="store_picks.php" method="post"> 16 <table border="1" width="80%" cellspacing="4" cellpadding="4" align="center"> 17 <tr align="center" valign="top"> 1/script_01_06.php (33 lines) 6 </head> 7 <body> 8 <?php # store_picks.php 9 // This page handles the data from the make_picks_form.php script. 10 11 // Set the week as a constant. | ||
| ||
phpforflash/appendix/basket.php (131 lines) 1 <? 2 // Flash for PHP 3 4 // Basket class phpforflash/chapter1/lvtest.php (9 lines) 1 <? 2 // lvtest.php 3 4 // Store message into variable 5 $Text = "This is the PHP loadvars test! Do you like it???"; 6 7 // Output to Flash movie in name/value pair format phpforflash/chapter1/register.php (84 lines) 5 $dbUser = "yourusername"; 6 $dbPass = "yourpassword"; 7 $dbName = "phpforflash"; 8 $table = "downloadLog"; 9 phpforflash/chapter1/register_setup.php (63 lines) 5 $dbUser = ""; 6 $dbPass = ""; 7 $dbName = "phpforflash"; 8 $table = "downloadLog"; 9 phpforflash/chapter10/addpoll.php (69 lines) 7 8 <? 9 // addpoll.php 10 // Case Study 1: User Poll - Foundation PHP for Flash 11 12 // If the form has been submitted... 13 if ($action == "add") { 14 // Include config file 15 include('common.php'); 16 17 // Connect to database | ||