Zend - The PHP Company




Code Gallery: yohgaki


Better PostgreSQL Metadata Function (Field name, type, length, etc)  

Type: code fragment
Added by: yohgaki
Entered: 08/03/2001
Last modified: 03/12/2000
Rating: - (fewer than 3 votes)
Views: 6357
This is an example code for getting PostgreSQL metadata from its system tables. I've seen several metadata functions that are not using PostgreSQL system tables, so I posted this. This function can get metadata MUCH faster than using many pg_Field*().


Convert array vars for SQL statement (Postgres)  

Type: code fragment
Added by: yohgaki
Entered: 11/04/2001
Last modified: 08/12/2000
Rating: - (fewer than 3 votes)
Views: 9054
Tired with adding quotes around vars for SQL query? Do you want to make sure supplied values are valid for fields? Do you want to use database default value, if user send no values and default value is defined for the field? Then this function might be useful.


PHP4 Session handling helper HTML file  

Type: code fragment
Added by: yohgaki
Entered: 12/02/2001
Last modified: 04/12/2000
Rating: - (fewer than 3 votes)
Views: 13513
This is HTML file with JavaScript to ensure Cookie and JavaScript is enabled. This file also can use for fall back to URL mode session. Many sites currently on the net will not work properly without Cookie and JavaScript. If your site does not work without JavaScript or Cookie, this may be useful.


PHP4 User Defined Session Handler for PostgreSQL  

Type: code fragment
Added by: yohgaki
Entered: 10/02/2001
Last modified: 04/12/2000
Rating: - (fewer than 3 votes)
Views: 11811
This is an example user defined session handlers for PostgreSQL. It includes some functions to access session data as an example


Protect values (GET/POST/COOKIE) set by PHP  

Type: code fragment
Added by: yohgaki
Entered: 25/07/2001
Last modified: 07/12/2001
Rating: ***** (5 votes)
Views: 22677
If you are sure that GET/POST/COOKIE values are not modified by user, you may be able to reduce lots of overhead for checking values. This function provide means to make sure GET/POST/COOKIE values that are set by PHP programmer are not modified by users.


Reguler Expression Test Page  

Type: application
Added by: yohgaki
Entered: 12/02/2001
Last modified: 04/12/2000
Rating: - (fewer than 3 votes)
Views: 12354
Simple reguler expression test page for both PHP and JavaScript. Now it supports both ereg() and preg_match(). Changed JavaScript test result is look similar to PHP's test result. (It displays entire matched string for JavaScript RegEx) It will be useful if you want to use the same regular expression to check form values both PHP and Client. It's probably useful people who are learning regex also.


Simplest template  

Type: code fragment
Added by: yohgaki
Entered: 08/08/2001
Last modified: 08/12/2000
Rating: - (fewer than 3 votes)
Views: 4840
Template function/class slows down site a lot, especially if it is implemented in PHP. This is an example code how output bufferring and include() can be used as template.




Search