The Wayback Machine - https://web.archive.org/all/20060820172557/http://www.zend.com:80/codex.php?CID=17
Zend - The php Company     Register  |   Log in  |   My Zend  |  
 

PHP 5
PHP General
PEAR and PECL
Forums
Resources
Documentation
Code/App Gallery
Code Gallery
Applications
Community
Code News
Downloads
Partners

Add Code Add Code


HTTP Add Code


7th latest php mailing list
with this script you can put 7th latest php mailing list from zend.com,
Type: code fragment
Added by: idban
Entered: 17/07/2000
Last modified: 07/12/2001
Rating: **** (6 votes)
Views: 8039
 
A HTTP POST
Posts an array of data to a given URL using rfc2616 - Hypertext Transfer Protocol -- HTTP/1.1
Type: application
Added by: daniel1
Entered: 07/11/2001
Last modified: 01/11/2000
Rating: **** (5 votes)
Views: 7214
 
A http://www.uptimes.net/ Faker
This 'program' fakes the information you send to uptimes, so you can make your windows 2000 pc, online for 6 years, and you linux 3.3.12 online for 6 years :-)
Type: application
Added by: inter
Entered: 15/08/2000
Last modified: 08/12/1999
Rating: * (7 votes)
Views: 5435
 
Amazon Affilate Grabber
The function GetBooks() receives a search term, looks up the best matches on the Amazon.com search engine, checks, if a cover image is available and returns an array of where href, img src and title of the books are stored in. Additionally, you can specify a temp folder where the results shall be cached.
Type: code fragment
Added by: til
Entered: 27/03/2000
Last modified: 08/12/1999
Rating: ***** (9 votes)
Views: 13888
 
Another version of latest mailing list archive
another version of php-general archive grabber
( this one use marc.theaimsgroup.com )
Type: code fragment
Added by: idban
Entered: 29/07/2000
Last modified: 08/12/1999
Rating: **** (6 votes)
Views: 5222
 
Anti-leech
Want to prevent people from linking to certain pages on your site? This tiny script will alow you to admit users to specified pages from other pages on your site, while preventing people from viewing your pages via outside links. Very reliable script, and extremely easy to set up...
Type: code fragment
Added by: Odey_dot_com
Entered: 01/08/2000
Last modified: 08/12/1999
Rating: **** (10 votes)
Views: 7676
 
Apache Web Server Log File Display Script
Parses an apache web server log file and displays each entry to the browser in html tables. Allows for filtering of output based on the 'status' field of the logfile entry (ie 404, 200, 304 etc). Still basic and obviously not recommended for users with low bandwidth and large logfiles(!). I did this because I couldn't find any existing scripts - plus I learnt a bit about log files in process. More than likely you will have to change the way the script extracts the logfile fields from each line, but at least the script gives you an idea how you could do it... I have a simpler version of the script which doesn't do filtering (just outputs two tables - 'success' and 'failure'(though failure includes 304 as well as 404 page requests)). This is perhaps easier to read - email me if you want it.
Type: application
Added by: munkfish
Entered: 12/09/2001
Last modified: 09/12/2000
Rating: - (fewer than 3 votes)
Views: 4445
 
Checking peoples online (the grabbing countinues...)
This program werk for checking someone online on Mailinglist on egroups
this sample checking it-center mailing list and find someone called Made
Wiryana if we found him so print that he online vice versa
hoply this program usefull for you
Type: code fragment
Added by: idban
Entered: 14/03/2000
Last modified: 07/12/2001
Rating: **** (8 votes)
Views: 6562
 
Convert US.
Currency Conversion U.S. Dollar
Type: code fragment
Added by: Bomm21
Entered: 14/07/2001
Last modified: 07/12/2000
Rating: - (fewer than 3 votes)
Views: 2382
 
Creating HDML Page
This code snippet shows how to send a PHP powered HDML page to a wireless device such as a cell phone, PDA, etc.
Type: code fragment
Added by: shane39
Entered: 13/06/2001
Last modified: 06/12/2000
Rating: - (fewer than 3 votes)
Views: 2500
 
Custom session functions
I had allways wondered how sites using PHP could count online users and do lots of fancy stuff with sessions. I decided to experiment and I created a set of session functions to replace the default php session functions. I use session_set_save_handler() to tell php to use my functions for sessions. This worked well but I then decided to make the set of functions into a class for use on any project, quickly and easily. The class uses MySQL but with some modifications can be used with other databases. To use all you have to do is include the class file in your script and change the mysql connection variables.
Type: class
Added by: Syberius
Entered: 09/01/2003
Last modified: 03/12/2002
Rating: **** (6 votes)
Views: 8009
 
Displaying WML pages with PHP
How to display PHP powered WML pages for wireless use in cell phones, PDAs, etc.
Type: code fragment
Added by: shane39
Entered: 13/06/2001
Last modified: 06/12/2000
Rating: - (fewer than 3 votes)
Views: 3093
 
Dynamic Pages with no '?'
A way to use full key=value type queries without using '?'. Useful for making a page for search engine friendliness.
Type: code fragment
Added by: bakins
Entered: 28/07/2000
Last modified: 08/12/1999
Rating: ***** (12 votes)
Views: 11322
 
ENOM reseller helper
see code comments
Type: class
Added by: conrad_escape
Entered: 28/01/2004
Last modified: 01/12/2003
Rating: - (fewer than 3 votes)
Views: 1703
 
Fake Apache DirectoryIndex Listing
If you want to have a Header and Footer on every page, including default apache directoryindexes, then you can use this script to generate a directory index instead of letting Apache do it. Combined with php's auto_prepend_file and auto_append_file, you will get your headers and footers on all documents served. Without this you would be trying to use the apache directives for HeaderName and ReadmeName, but they only work if the file to use is inside the directory that apache is giving a listing of (you can't spacify a URL or absolute path for those 2 directives in a top level .htaccess file). This is good if you have a giant site with a ton of subdirectories and you dont feel like going around creating ReadmeName and HeaderName files for Apache to use. The down side if that all docs must be parsed as php for auto_append and auto_prepend to work. The upside is that PHP is great. This code was modified from source provided by http://www.webaugur.com/wares/autoindex written by dave at webaugur. com
Type: code fragment
Added by: flight553
Entered: 10/03/2001
Last modified: 03/12/2000
Rating: - (fewer than 3 votes)
Views: 8912
 
Forcing MSIE to download files with the proper name
Due to some bugs on MSIE browsers, when trying to force the browser to download a file specifiying the name of the file (via Header), it fails. This code is the solution.
Type: code fragment
Added by: cYbErDaRk
Entered: 29/08/2002
Last modified: 09/12/2001
Rating: - (fewer than 3 votes)
Views: 2988
 
Google Domain Collection
This simple code work for collection domain(co.*) from google.com
Type: application
Added by: castamaster
Entered: 06/09/2001
Last modified: 09/12/2000
Rating: - (fewer than 3 votes)
Views: 2858
 
Grabbing Dictionary(2)
Grabbing English-Indonesian Dictionary from www.kamus.web.id put it in your page. Only display the result from the keyword you search.
Type: application
Added by: emha
Entered: 18/05/2001
Last modified: 05/12/2000
Rating: ** (3 votes)
Views: 2449
 
Grabbing tools
Grabbing some html put it in your page, i hope this is use full for you,
you can grab any information from net and put it on your page as your
information :) btw be sure to ask permission from the site before you grabbing their
info :) they gonna bombed ( hits i mean ) like your page hited!
Type: code fragment
Added by: idban
Entered: 02/03/2000
Last modified: 07/12/2001
Rating: **** (11 votes)
Views: 20148
 
Grabbing tools II
Grabbing some html put it in your page, i hope this is use full for you,
you can grab any information from net and put it on your page as your
information :) btw be sure to ask permission from the site before you grabbing their
info :) they gonna bombed ( hits i mean ) like your page hited!

note:

on this version will cover the error if the target site down!
Type: code fragment
Added by: idban
Entered: 26/03/2000
Last modified: 07/12/2001
Rating: **** (12 votes)
Views: 10127
 
grab_domain
I had one web site with over 30 different domain names pointed to it and I needed to write a little fragment that would return a variable giving me the Fully qualified domain name someone came to my site with to determine some basic page elements and a database query. This is not perfect (see note below), but it did do the job for me. The problem was that people could reach the site using different variations of the differing domain names such as http://domain.com and http://www.domain.com . I looked around and found a little used PHP constant and expanded it a bit and came up with the following. I also noticed there were others out there trying to accomplish the same thing using the HTTP_REFERER constant, however, that only works if the person coming to your site was referred there, this will cover those who type in your domain name as well as those that are referred. With the returned variable from this function you can customize your site however you like with an accompaning statement to define your values. NOTE: This only works if the host name in question is either http://domain.com or http://www.domain.com I would like to expand this function to allow for sub domain's such as http://subdomain.domain.com . As it stands it will only strip out "www" if it exists. If there is someone out there who could write a fancy regular expression which would accomplish the task so the function returned only the Fully Qualified Domain Name I would be forever greatful! CHANGES: 1.0 to 1.1 global $HTTP_HOST variable is now pulled from within the function.
Type: code fragment
Added by: amiller
Entered: 24/05/2001
Last modified: 05/12/2000
Rating: - (fewer than 3 votes)
Views: 3100
 
HTTP 1.1 and 1.0 Cache Validator
Dynamic server pages normally don't send information to allow cache expiration control and if-modified-since requests. Therefore, web caches and browsers have problems with those dynamic contents (they either refresh always or show expired pages). I provide a easy to use function that must be called with the last modification date of the data base/dynamic content. It complies with HTTP/1.1 (RFC2616) and HTTP/1.0 strong and weak validators. It also takes in account, and differentiates that the same page might be accesed anonymously or user authenticated. The original version was implemented in bulma.lug.net, which uses PHP4 and Postgres7.
Type: code fragment
Added by: gallir
Entered: 26/01/2001
Last modified: 01/12/2000
Rating: - (fewer than 3 votes)
Views: 6534
 
HTTP Referral Validation
Determines if user was referred by your site. Easy to configure. Very useful security script to make sure that the referred host is allowed to access the script.
Type: code fragment
Added by: mvilla213
Entered: 04/11/2000
Last modified: 01/12/2000
Rating: - (fewer than 3 votes)
Views: 4640
 
ICQ Pager
A simple class to send ICQ Pager.
Type: class
Added by: shiftmethod
Entered: 12/10/2000
Last modified: 01/12/2000
Rating: **** (4 votes)
Views: 4781
 
ICQ Status Checker
The function get_status($uin) checks the icq status of of the uin "$uin". The possible "returns" are online, offline, disabled, and unknown.

Please report any bugs, comments, or ideas on how to improve this script to me.

A similiar script is available here.
Type: code fragment
Added by: billzeller
Entered: 13/07/2000
Last modified: 08/12/1999
Rating: **** (8 votes)
Views: 15035
 
LockDown Pro Anti-Leech Bandwidth Protector
The easiest to install effective bandwidth protector on the market. Set it up easily in less than 5 minutes and your on the way to big bandwidth savings!
Type: application
Added by: Odey_dot_com
Entered: 10/01/2001
Last modified: 01/12/2000
Rating: - (fewer than 3 votes)
Views: 4781
 
Lumber Jack
Lumber Jack log's all visitors screen a web surfing statistics to a mysql database then display's them with the gd library in either a line graph or a pie chart.
Type: application
Added by: astrix
Entered: 06/11/2000
Last modified: 01/12/2000
Rating: **** (5 votes)
Views: 5147
 
modify url
Modify GET variables in a URL.
Type: code fragment
Added by: tim
Entered: 02/03/2000
Last modified: 08/12/1999
Rating: - (fewer than 3 votes)
Views: 5981
 
my.mp3.com playlist shuffler
my.mp3.com playlist shuffler. this class is designed to be used in a script which itself is designed to be used in a link on your my.mp3.com radio station, allowing real-time shuffling of your current playlist to be downloaded into the visitor's mp3 player.
I'm using fopen to download the html, eregi and preg_split to parse for the stuff I want, and curl to get it. Working on adding a logfile.txt so you can see who's been using your link
Type: class
Added by: khote
Entered: 11/06/2001
Last modified: 06/12/2000
Rating: - (fewer than 3 votes)
Views: 2547
 
PHP4 Session handling helper HTML file
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.
Type: code fragment
Added by: yohgaki
Entered: 12/02/2001
Last modified: 04/12/2000
Rating: - (fewer than 3 votes)
Views: 8976
 
PHP4 User Defined Session Handler for PostgreSQL
This is an example user defined session handlers for PostgreSQL. It includes some functions to access session data as an example
Type: code fragment
Added by: yohgaki
Entered: 10/02/2001
Last modified: 04/12/2000
Rating: - (fewer than 3 votes)
Views: 7523
 
phpODP Class
I hope this is in the right catagory...heh.

A class for retrieval of ODP catagory data. This class sets a small number of variables to allow you to output the data retreived anyway you want.

It's still a work in progress, so all the help I could get from people interested in updating it or something would be very helpful.

In this newer version (1.0UF2), i made it possible to output RSS for each catagory pulled from the ODP.

Type: class
Added by: gren
Entered: 14/04/2000
Last modified: 08/12/1999
Rating: - (fewer than 3 votes)
Views: 3668
 
Post as Get Method
Use this code to make a Post method act like a Get method.
Type: code fragment
Added by: crackbaby
Entered: 01/06/2000
Last modified: 08/12/1999
Rating: ***** (4 votes)
Views: 5541
 
PostIt
Let your PHP script pretend to be an HTML form! This function takes an associative array and a URL. The array is URL-encoded and then POSTed to the URL in HTTP 1.1 format.
Type: code fragment
Added by: Darguz
Entered: 13/03/2000
Last modified: 02/12/2000
Rating: **** (6 votes)
Views: 8688
 
Print all POSTed variables
Print all variables that arrived by POST, including arrays
Type: code fragment
Added by: ADMIN
Entered: 18/01/2000
Last modified: 08/12/1999
Rating: **** (12 votes)
Views: 6830
 
simple redirection
for designer who use many htmls for his/her site to spesific browser, this is just a sample you can customise by your self.
Type: code fragment
Added by: idban
Entered: 06/12/2000
Last modified: 07/12/2001
Rating: *** (3 votes)
Views: 16120
 
small function that validate arguments passed by GET/POST or others
a small function that can validate arguments passed by GET/POST. can be use on any arguments validation case.
Type: application
Added by: yszhang
Entered: 12/11/2002
Last modified: 01/11/2001
Rating: - (fewer than 3 votes)
Views: 2060
 
Space Eater
if u use any (text) variable for your ID you will have problem with browser compatibility,
how to get rid off from space? u can use this.
Type: code fragment
Added by: idban
Entered: 24/04/2000
Last modified: 08/12/1999
Rating: **** (8 votes)
Views: 3839
 
Sub-Domain Redirect/WorkAround
This will allow your users to be redirected according to wub-doamin prefix.
Type: code fragment
Added by: Plove
Entered: 09/11/2001
Last modified: 01/11/2000
Rating: - (fewer than 3 votes)
Views: 2835
 
URL sanity checker and rebuilder
Gets an URL and converts it to standard format (eg. ftp.somewhere.org - ftp://ftp.somewhere.org/). It can distinguish ftp scheme, when the hostname starts with 'ftp'.
Type: code fragment
Added by: julian7
Entered: 05/01/2001
Last modified: 01/12/2000
Rating: - (fewer than 3 votes)
Views: 2975
 
URL string from array of variables
A simple function that takes an array such as HTTP_GET_VARS and creates an url variable string from the elements. This string can then be used in a link to another page. Especially useful for Last Page / Next Page / Modify Search buttons on search pages.
Type: code fragment
Added by: twilop
Entered: 16/11/2000
Last modified: 01/12/2000
Rating: - (fewer than 3 votes)
Views: 3293
 
User Agent Info
Resolves from $HTTP_USER_AGENT operating system and browser. It know: Operating systems: Win3.1, Win3.11, Win95, Win98, WinME, WinNT, Win2000, WinXP, Win.NET, WinCE, MacOSX, MacPPC, Mac68K, Linux, FreeBSD, NetBSD, Unix, HP-UX, SunOS, IRIX, OSF1, QNX Photon, OS/2, Amiga, Symbian, Palm, Liberate, Sega Dreamcast, WebTV, PowerTV, Prodigy. Browsers: Amaya, AOL, AWeb, Beonex, Camino, Cyberdog, Dillo, Doris, ELinks, Emacs, Firebird, FrontPage, Galeon, Chimera, iCab, Internet Explorer, Konqueror, Liberate, Links, Lycoris Desktop/LX, Lynx, Netcaptor, Netpliance, Netscape, Mozzila, OffByOne, Opera, Pocket Inetrnet Explorer, PowerBrowser, Phoenix, PlanetWeb, PowerTV, Prodigy, Voyager, QuickTime, Safari, Tango, WebExplorer, WebTV, Yandex.
Type: class
Added by: risko
Entered: 14/11/2003
Last modified: 02/11/2002
Rating: - (fewer than 3 votes)
Views: 2682
 
WAP and WEB TV redirect
This top lines inserted in index.php preserves the same URL to WAP, WEB TV or traditional browsers users. Example: Instead of http://nave.net/wap , http://nave.net/webtv and http://nave.net ,all users goes to http://nave.net with any browser and be redirected to correct patch.
Type: application
Added by: navex
Entered: 19/08/2000
Last modified: 08/12/1999
Rating: - (fewer than 3 votes)
Views: 6920
 
Web Page Update Check
This class allows you to check to see if a particular website has been updated recently. It doesn't show what the changes were, just the fact that it's been altered in some way since you last checked the site.
Type: class
Added by: amnuts
Entered: 14/01/2004
Last modified: 01/12/2003
Rating: - (fewer than 3 votes)
Views: 2514
 
Yahoo Status Checker
The function yahoo_status($user) checks the yahoo status of of the user "$user". The possible "returns" are Online, Offline, and Unknown.

Please report any bugs, comments, or ideas on how to improve this script to me.
Type: code fragment
Added by: billzeller
Entered: 17/07/2000
Last modified: 08/12/1999
Rating: **** (3 votes)
Views: 6374
 

Search


This Category All Categories

 

Contact Us  |  Terms and Conditions  |  Privacy Policy  |  Site Map
Copyright © 1999 - 2006 by Zend Technologies Ltd. All rights reserved.  
PHP 5 Zend Platform