Algorithms Arrays Passwords Uncategorized
Commerce Uncategorized
Databases Abstraction Layers Informix LDAP MS SQL MySQL ODBC PostgreSQL Uncategorized
Date & Time Calculators Conversion Translation Uncategorized
Discussion Chat Forums Guestbooks Polls Uncategorized
Email Validation Uncategorized
External Uncategorized
Files and Directories Uncategorized
Games Uncategorized
Graphics 3-D Graphs Resizing Thumbnails Uncategorized
HTML Forms Menus & Navigation Source Viewers Tables Templates Uncategorized
HTTP Authentication Cookies File Uploading Uncategorized
I18N Uncategorized
Math Uncategorized
Miscellaneous Uncategorized
Searching and Trees Uncategorized
Security Uncategorized
Text Uncategorized
Utilities Calendars Counters Link Checkers Weather Uncategorized
XML Uncategorized
| php sample source codes |
|---|
|
Don't lose your website visitors when they link out of your website!!
A short frame with "Back To My Site" and "Remove Frame" will be added to the top of any external URL link.
|
|
This script allows you to send SMS (also long SMS), EMS, RTTTL-Ringtones, Logos (GIF, JPG, PNG) with automatic image resizing, EMS Pictures with copy protection and autosave feature, Nokia Operator Logos, Nokia Multipart messages and so on. Pictures and Ringtones can be HEX-included or specified to be downloaded from a HTTP-source. You can setup the 2-way service within minutes on TrueSenses.com. Requires NO additional libraries programs or databases.
|
|
Allows guests to rate something 1 to 5 stars, then takes the results and returns a number of stars based on the average rating. If you try the script and get an error regarding the file 'ratings.php', try downloading the zipped file at http://habitat675.port5.com/rate/ratings.zip and chmod ratings.php 666. File also includes star images which you are free to use if you like, or you can use your own.
|
|
A clean way to add a header and/or footer to pages automatically.
|
|
Works by fetching the whois server from whois.crsnic.net if com,net,org,edu address, sets the whois server it to countrycode.whois-servers.net for au,uk,etc. and sets the whois server to whois.arin.net for ips. Then it queries the aproprite whois server.
|
|
Works with the new registry system. Fetches whois server for the domain then queries that server for the registration data.
|
|
Add "Go Back" Frame to external links
|
|
Tired of tiping backslashes into the HTML-Code inside of PHP-code? Just drag and drop it into the Textbox and click. Ready.
|
|
This is a simple class that just alternates between values given to it, good for tables which alternating cell backgrounds.
|
|
use print_array($variable) to dump the contents of a variable of any type including objects or arrays into any easy to read html format.. It supports recursive object and arrays
|
|
Function that appends a string to a specified log file.
|
|
This is a function I wrote that runs through a single dimensional array and assigns variables based on the key names.
|
|
Takes an array and assigns it to the global space.
|
|
header and footer in php4
|
|
Tests bandwidth with a random string.
The size of the random string can be altered.
Warning: when the script is set up to generate a large amount of data, your server may crash.
|
|
Simple bbcode validating function
|
|
Utility Class with some useful functions to populate and retrieve values of JavaBean-like objects.
Inspired be Jakarta Commons BeanUtils (http://jakarta.apache.org)
|
|
A function that check best before dates on links to local files.
Add new's flash or mark the link red on new files.
Send a mail to the creator if the file are old.
Check updates on your webcam and display a messgage if you are out of office.
|
|
A function that check best before dates on links to local files. Add new's flash or mark the link red on new files. Send a mail to the creator if the file are old.
Check updates on your webcam and display a messgage if you are out of office.
|
|
A News-Frontend for the news-section of the german TV reality show "BigBrother". At this time the script is only in german. if someone from outside of germany is interested in an english version, please contact me!!
|
|
If you need to keep track of a lot of on/off toggles, like user settings etc. There is only one easy way to store and manipulate these values: <B>Bitfields</B>. With these functions manipulating bitfields becomes easy. Everything you need is included below.
|
|
Maniac's bit manipulation routines, wrapped into a simple class object.<p>Newbies, think of this class as a kind of array of up to 32 true or false values, squished into a tiny amount of space.
|
|
This function will count number of bit who are set to 1 in a integer.
|
|
Blogsoft is a free blog script that allows you to retrieve your web-log from any web page on the Web with 1 line of javascript.
|
|
This code takes in a string of keywords and evaluates the string, turning it into three collections of strings based on the boolean operators in the string. Please send comments on how I can improve the code. I'd love to get some feedback.
|
|
Cacher allows you to cache variables (anything that can be put into a variable) for later use. This speeds up loading time, and reduces load on the data source.
|
|
Totally useless script to caesar shift a given message.
|
|
classKurs is a PHP class that lets you grab Bank Indonesia's content of kurs, then put the content on a single file. The grabber can be set as cron job. There is also the function to show the grabbed file in formated html tags, ready to go.
|
|
Show everyone how many times you've been hit by the CodeRed Virus
|
|
ContentBuilder is a powerfull news- and article-management
system for smaller sites. We call it pluggable CMS, because
its possible to add own Modules without changing the running
system. The system uses PHP and MySQL for data-processing.
It allows you to easily add, delete and modify articles,
users and headlines. It features multi-user access levels
and multiple file upload. All settings can easily be
configured via a web interface.
|
|
This is a down and dirty COPPA age verifier. This function takes 3 args. A birthday, a birthmonth and a birthyear and returns the users actual age if it's good and false if it's non-compliant. Throw this into a general include file and slap it in your library and you won't have to worry if you're letting any kids in. This is an important issue since it's illegal to gather user data if the person is under 13 years old.
|
|
A class for doing serverstatus-queries against Halflife/Counterstrike servers
|
|
I snagged the US State array posted here, but I needed countries as well. I snagged it as a CSV list at http://www.din.de/gremien/nas/nabd/iso3166ma/codlstp1/db_en.html and wrote a little function to print out the list in array format ;-]
|
|
$argv handling function
|
|
a few simple functions to check the validity of internet hostnames, IP addresses etc.
|
|
If you have been looking for a databasesolution using locking of the session for the duration of the script, and couldn't find any, here is one.
|
|
a simple class to check domain's with whois. it gives 0 or 1 return. ok, it is one of thousend ;-)
|
|
Use this code to connect to the dhs servers and update your ip address and other information (useful with another standalone script running from cron to check for a change in ip over roadrunner or dsl)
|
|
Provides a mechanism to generate binary compatible DOCSIS 1.0 through an easy to use PHP class
|
|
Function to check is a domain available or not?
|
|
Simple domain check using host -t command.
|
|
Checks to see if a domain name exists and suggest alternatives based on alternative tlds.
Uses host command to find the domain
|
|
A patched version of Jan Fredrik Leversund's <a href="http://px.sklar.com/code.html?code_id=124">dumper</a>. Dumper, like Perl's Data::Dumper, provides a string representation of a data structure. The string can be eval'ed to recreate the data structure. This version will nicely list object properties instead of just displaying the serialized bytedumps.
|
|
Dump any resource with syntax highlighting, indenting and variable type information
|
|
The most interesting feature is probably displaying the highlighted source code that triggered the errors.
It also allows logging errors to syslog and dumping context on fatal errors.
|
|
Whit this lines of code, you can link to external servers whit a frame of your site...
|
|
Whether your external links are in a mysql database or a flat file or on the html page, this utility checks to see if their hosts are in service.
|
|
Returns an array of files under a given directory whose names match a given pattern.
|
|
grab latest news at freshmeat.net, and
attach to your web page.
|
|
This function allows you to create an alias for a function.
For example if you do not like the function name 'substr', create your own alias named 'mid' (perhaps you know this function name from BASIC).
It does not work with function which use references.
|
|
A speedy search engine using <B>eXtreme</B> fuzzy methodoloy. Using MySQL for storage of data, it searches the table for either exact or fuzzy matches.
|
|
Get the value of a string or array
If an array is passed, then it is split into two components: the array name and its keys. If you pass array('array','one','two','three'), then the resulting variable name would be $array['one']['two']['three'].
This can be up to an infinite depth.
This is especially useful in Objects. It was specifically designed for that purpose.
|
|
Function to get meta keywords of any page and output an array.
|
|
This is a simple function that creates a link to a mapquest link. The function accepts the a street, city, state, zip and optionally a string for the link. If the link string is not set it uses the address for the link string.
|
|
Function to get all variables sended on any query and output this an array.
|
|
Records the query strings people used to find your site through Google.
|
|
Wow! Now you can Grab from a web page any information and put it automatically in your home page. Cool for weather, news and more...
|
|
This little function will help you debug scripts, specially if you use a lot of objects and arrays. it prints a beautified version of the 'print_r' output. <br><br>
if you add this function to your script, just call your script adding ?debug=1 (script.php?debug=1)or add the $debug global variable set to true to see the debugging output
|
|
This guy will reveal the true IP Address behind the cleverly hidden ones you normally get in spam email
|
|
simple html validating function
|
|
this function returns the status of a given icq number (online,offline,disabled).
after endless looking for an icq status checker in php and discovering some none-working, i found out the easy way icq handles the status images and wrote a small function to parse their reply stuff to a status image query.
|
|
ImageThumb is a small piece of software written in the PHP language that lets you create thumbnails on the fly for a given image, whether it is local ore remote.
Currently supported formats are GIF, PNG and JPEG.
Now supports thumbnail caching.
To use this script, you must have the GD library installed, and obiously a webserver capable of running PHP scripts (PHP >= 4.0.4)
|
|
Converts a binary IP to human-readable representation.
This is a compatibility implementation of the original inet_ntop function at :
http://www.php.net/inet_ntop
|
|
Simple tool to help start documentation of object tree.
It shows the inheritance diagram for all declared classes, and shows interface for the classes. Can be used dynamicaly (cached), or it can generate static html documents.
In class representation inherited properties and methods are grey.
It can be configured to display all declared classes, or only user defined classes, or user defined classes with necessary built in classes due to it's inheritance.
|
|
The inline class provides methods for creating and destroying local variable scopes. Simply put, local scopes are spaces where some or all of the global variables are temporarily hidden.<br /><br />
This behavior is useful when debugging, or for making emergency hacks to code.<br /><br />
<b>Methods include:</b><br />
<br />
<tt> inline()</tt> (class constructor) - create a local scope for one or more variables.<br /><br />
<tt> get_global()</tt> - find the value of a hidden global variable.<br /><br />
<tt> get_globals()</tt> - find the values of all the hidden global variables.<br /><br />
<tt> export()</tt> - export a local variable to global scope.<br /><br />
<tt> export_all()</tt> - export all local variables to global scope.<br /><br />
<tt> exit_scope()</tt> - exit the local scope and destroy the class variables<br /><br />
|
|
This class provides an interface to poppassd, a commonly used daemon to enable password changes via the network, particularly using the Eudora mail client. Take care to ensure the safety of your password data in transit! I recommend using this script only over SSL.
|
|
IP hider, Obscure Any URL Anonymity, connection lores, obfuscation, corporate survival
base on http://www.searchlores.org/obscure.htm
|
|
remember JAPH? Just Another Perl Hacker, ( <b><a href="http://www.cpan.org/misc/japh">http://www.cpan.org/misc/japh</a></b> ) lets start with JAPC, Just Another Php Coder :)<br>
just <b>cut and paste</b> code this code and use as signature :)
|
|
CUSTOM 404 - HTM TO PHP SCRIPT
This custom .404 script performs some valuable, practical functions:
1). For Web developers who are transitioning large, static HTML sites to much more powerful PHP versions it allows you to replace pages gradually and TRANSPARENTLY without sacrificing your internal or external link integrity. All links to your pages can remain the same (i.e. .htm, .html, etc) even AFTER you replace them with same-name .php versions. What this does is prevent you from losing any position in the search engines and also keeps all your internal and incoming links from other sites operating and active.
2). You don't have to use the (Apache) Mod_Rewrite module, Force_Type directives or even have access to your .conf file in order to use it. This is especially useful for those running several virtual domains on the same server and need separate rules for each.
3). When your new PHP pages are in place, you can still submit them for re-indexing with the search engines and directories using the (more friendly and common) .htm extensions.
4). By leaving this .404 script in place, you can simply add different header locations or file includes ($page.php) to it later that redirect to, say, your database scripts or other PHP pages that perform different functions. In this way you can create literally thousands of (what appear to be) normal, static .html pages which (actually) do not exist, but are php-created on the fly.
|
|
Generalized caching library, usefull for caching of variables through the use of serialize or any type of file you wish to have cached.
|
|
Useful class to transfer variables through an url.
|
|
This code times the build and download of web pages without the need for PERL or JavaScript and has minimal code in this demo, but can be built into a full tilt tracking system.
|
|
This PHP script shows how to lookup country origin by using visitor's IP address. This example required an external ACCESS database for lookup purpose. Full database is available at http://www.location.com.my.
Developers use this script for projects related to:
1. Display native language and currency
2. Redirect based on country
3. Digital rights management
4. Prevent password sharing and abuse of service
5. Reduce credit card fraud
6. Web log stats and analysis
7. Auto-selection of country on forms
8. Filter access from countries you do not do business with
9. Geo-targeting for increased sales and click-thrus
10. And much, much more!
|
|
This is the PHP interface module for Voicent Gateway, a VoiceXML
gateway for your PC. You can use this interface module to make telephone calls from your perl program, provided that the Voicent Gateway is installed and can be accessed through HTTP. There is a FREE version of Voicent Gateway program downloadable from:
http://www.voicent.com/download
|
|
Searches through directories of text based files for a string. Configurable parameters are: extensions to search through, and directories to search through. I use it to search through my code library.
|
|
MetaSearch is a variation of SiteSearch 1.2 which only searches
Meta keyword tags instead of all the text on the page.
|
|
Meunity is a Web-based community system that uses PHP. It is object oriented, so it is easily extendible. Its database abstraction layer allows it to be compatible with multiple databases. It is easily configurable, and includes content management systems and advanced administration.
|
|
retrieve mp3 files info (bitrate, duration, layer, etc) and id3v1 tags (artist,title, etc.), send file playlist, stream file with icecast headers url a few methods are broken, and need to be completed (I have no time for this). File info and properties reading works ok.
url is http://www.sumatrasolutions.com/
|
|
You can nest require('page.php') based on variables, this can lead some very dynamic application/modules that can all run from a single interface...
|
|
Consulta de dominios, hosts, mx, en servidores DNS. DNS query.
|
|
Trick to print how many surfers are connected to a page.
|
|
PHP class for use with OPML (Outline Processor Markup Language) files. OPML is a XML-based file format for outline-structured information.
More info at http://www.opml.org
|
|
Have you every tried to get the title or subject of a pdf, only to find that it moved on you? Here's the code that can help you out.
|
|
This class helps you to create pdf documents from xml sources.
|
|
phat is a class to make running the shell at commands (at, atq, atrm) easier from within PHP.
|
|
Parse directory and search data from the Open Directory Project (dmoz.org) and format it to your site's look and feel.
|
|
Phoogle is the winner of the first ever PHP Coding Contest at http://codewalkers.com - it was coded by Jon Bardin. Phoogle does some manipulation of google and google groups search results. It is a wonderful example of using sockets.
|
|
4 code fragments to
- set data in PHP and start matlab script
- run matlab script
- read data from matlab script and redirect to php page
- display result in php
|
|
Code exapmles to pass variables from a PHP page to a matlab script and back.
|
|
This project includes some classes which are used to generate very simple MS Excel file (xls) via PHP. The generated xls file can be obtained by web as a stream file or can be written under $default_dir path. It has very simple usage to generate xls file from a select query using mysql, pgsql, oci8 databases.
Limitation:
- Max character size of a text(label) cell is 255
( due to MS Excel 5.0 Binary File Format definition )
Please get the full pack at
http://sourceforge.net/projects/psxlsgen/
|
|
Simple PHP script to display IP Masquerade
Table.
|
|
whois on indonesian domain, our nic isnt open but they have CGI, <br>so i use php to praser their CGI output :)
<br><br>
this is update version, they change<br>
http://whois.idnic.net.id/cgi-bin/whois-cgi<br>
to <br>
http://whois.idnic.net.id/cgi-bin/whois.cgi<br>
<br>
please update your indo domain lookup!
|
|
This php script allows you to view man pages through a web browser.
|
|
If you want to use PHP to populate fields in a PDF form (for instance, extracting data from a database and prefilling fields for the user) and you don't have the FDF module available to you for whatever reason, this function should work. Regardless, I think this function is more straightforward to use than the FDF module functions.
|
|
I use this to make my windows 2000 Internet explorer bookmarks available from a webpage. This code is very basic and will require modification to be of use elsewhere (I make specific references to my filesystem layout).
The linux box mounts two w2k drives as /mnt/gleghorn/khome and /mnt/gleghorn/favs, a miscellaneous area and my MSIE bookmarks respectively. The code refers to preform.phps. This is just a symbolic link to preform.php
I specify preform.php as the last in the apache DirectoryIndex list, followed by index.html, default.html etc. When browsing either of the two mounted drives, if invoked by the absence of anything else indexy, it scans the directories and pretty-prints what it finds. Any MSIE-style *.url files are written out human-readable and clickable.
hash include standard disclaimer
|
|
A function that returns the running processes list of windows in an assosiative array
|
|
For all you students out there with over-restricted internet access this will get around it! Just open this page from school and enter the desired url. The internet blocking software thinks its viewning a harmless page and not the blocked one! There is a MySQL based login built in that can be uncommented and used if you have access to a MySQL database as well.
|
|
This script downloads the contents of a site and displays it. Changing all the links.
|
|
A little function I created to read the dimensions (width, height) of an Adobe Photoshop image, or PSD. PSDs exported by third-party programs normally don't have the required embedded tags to be read. If the file is unparsable, the function returns null. If it can, however, it returns an array with the width at index 0 and the height at index 1.
|
|
Diagnostic utility for displaying all query pairs in a table.
|
|
A PERL app to quickly create complete PHP classes from the command line.
|
|
This simple ad banner rotator can actually be used to randomly serve any file (via an include) on a php page, not just an ad banner. Ad tags which contain multiple links, or images will not break the page which display it. get it at <a href='http://markdonline.com/code/code.php3'>http://markdonline.com/code/code.php3</a>
|
|
<p>Use this script to automatically add a random background music to your site. Requires the use of an extra frame, to make sure the music continues, even if a visitor navigates to another part of your site.</p>
<p><b>This script ain't perfect yet! I've never learned PHP, but I managed to wrote this one so any suggestion is greatly appreciated!</b></p>
<p>Some words in the script are in Dutch. If this gives any trouble, just mail me at mark@mjansen.doge.nl and I'll translate them for you.</p>
|
|
This is a redirect function that takes care of most redirect functions (session, vars, ect). Uses the header function so you must call this function before any html output. THere are 4 types of redirect built into this function.
<br><br>
First is a simple redirect called like this redirect("page.php");
<br><br>
Second redirects and adds session info and is i called like this redirect("page.php", 1) the '1' tells the function to add the session info.
<br><br>
third is redirecting while adding variables to the url. called like this redirect("page.php",2,$my array) $my_array contains the variables and values to pass.
example
$my_array[0] = "var1=12";<br>
$my_array[1] = "var2=15";<br>
$my_array[2] = "var3=78";<br>
redirect will result in /page.php?var1=12&var2=15$var3=78
<br><br>
THe last redirect is a redirect passing both URL variables as well as session information. redirect("page.php",3,$my_array);
|
|
This short patch will allow your scripts to continue working if register_globals is changed to off, without any further modification of your scripts.
|
|
With more and more people using FrontControllers (pagination scripts) to have one entry point to applications or homepages - I found a need for a function that took a request url (or any url) and replace certain values of arguments or even to remove some arguments. This function does exactly that. It takes an input string and then replaces or removes arguments.
|
|
To <B>replace</B> in $str all the [some] with the value in $some,<BR> and with the {some} with the $art["some"].<BR>
With support for more then 1 {} of [] on 1 line.<BR><BR>
If you have some better source for this, please mail me....
|
|
rWhois (see rwhois.net) in PHP.
You can use this function to get geographic data back on on an IP, City/State/Zip this might come in handy if you are attempting to geo-target an IP by country, say, for an ad program.
|
|
Want your customer to save your article, product catalog, or just a document to PDF format? PDF is very easy document format because it's portable, they can print it anywhere.
|
|
fetch your Seti@Home UserStats
|
|
Class to manage User and Group Accounts on Shadow based Linux/Unix Systems
|
|
Shared memory examples, there are few examples to be found just about anywhere on this subject, I wrote these up a few months ago and am posting them here in case anyone might need these.
|
|
Slots and Signals
=================
This code is a simple implementation of the slots/signals concept.
Slots and signals are used by the Qt toolkit as a kind of extra-powerful callback.
The best source of information on them is the Qt toolkit docs
see (http://doc.trolltech.com/3.0/signalsandslots.html)
To briefly summarize, they allow you to bind a signal to one or more slots and/or signals.
When a signal is 'emitted', all slots and signals bound to it are called. Each slot corresponds
to a single function. When a signal is called by another signal, the called signal is emitted,
calling the slots and signals that it is bound to.
Any parameters passed when the signal is emitted are passed to the slots and signals that
that are called. This easily allows you to write handler functions (slots) and bind them to events
(signals) as needed - without having to make explicit function calls or rewrite handler functions
just to accomodate minor modifications in how a function is called.
I find slots and signals particular useful for message passing and error handling.
Have Fun! :)
Zak Greant
|