Just for the fun of it: from www.userfriendly.org see www.calvinandhobbes.me this is so old, I don’t remember where it came from:
Be sure your error reporting is turned on: (for your testing copy or for your IP address) @ini_set('display_errors', '1'); error_reporting(E_ALL ^ E_NOTICE); If it is and you still get nothing but a blank page … then, by all means, your next step might be to take the syntax check option built into PHP! From a linux/unix command line (terminal session), run php with its...
The Internet is converging on UTF-8 for a common / universal character encoding. Set your apache environment to utf-8 by adding ‘AddDefaultCharset utf-8’ to your .htaccess. If you do not use apache add ‘default_charset utf-8’ to your php.ini. You have to do either of them (not both), php will use the apache setting where needed. And, of course, your html-header: ‘< meta http-equiv="Content-type" content="text/html;...
It is possible for a hacker to enter the following seemingly innocuous text into the UserName textbox to gain entry to the system without having to know a valid user name and password: ‘ Or 1=1 — The hacker breaks into the system by injecting malformed SQL into the query. This particular hack works because the executed query is formed by the concatenation of...
Sample introductory Object Oriented Programming code in php, java, and C++ showing the similarities and differences. With the possible exception of large, long-term projects, OOP, despite all the hype, is a lot more expensive to write and to maintain than clean structured code. The reality of it does not live up to the theory, and the hype is often “smoke and mirrors” unfortunately. This...
4 sample C utility programs that came with MySQL 1. connect_test.c 2. select_test.c 3. insert_test.c 4. list_test.c They came with the disclaimer below. /* connect_test.c A program to connect to a database. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation;...
This program was written back in the days of cassette tapes!: Screen I/O pgm in C & Pascal. This program will go through a list of songs, throwing out one song or another until it finds a total time that most nearly matches the target time. It will display and write to a (text) file the new (sub) list and, separately, the song(s) that...
updated 2019-09-15 Checking ctype_digit() only checks strings from the manual: $strings = array('1820.20', '10002', 'ws123'); foreach ($strings as $testcase) { if (ctype_digit($testcase)) { echo "The string $testcase consists of all digits.\n"; } else { echo "The string $testcase does not consist of all digits.\n"; } } The above example will output: The string 1820.20 does not consist of all digits. The string 10002 consists...
Written to copy a large file across several floppy disks!: Simple example of file I/O, buffering, and input parameters. The pgm breaks a file into diskette (or any) size pieces. if the parameters are not correct, instructions are written to the screen. #include /* BREAK UP . C */ #define FALSE -1 /* +----------------------+ */ #define TRUE 0 /* | This c program is...