332 Reusable Code Snippet Topics

Remove Filter
Member Avatar for
Member Avatar for Banderson

[COLOR=Blue] Ever since PHP turned register_globals_off I have had problems here and there in my codes. I searched hard and long for a simple fix while keeping globals turned off. Fortunately, I found one! I have posted it below for your convenience and it is also described [URL=http://www.nasatech.com/PHP-DOCS/faq.misc.html#faq.misc.registerglobals]Here[/URL]. I'm not …

Web Development php
Member Avatar for Banderson
0
430
Member Avatar for vegaseat

Using an SDL (Simple DirectMedia Layer) wrapper is one way to play sound and music with Ruby. I have tested this snippet with .MID .MOD and .WAV files and it performs well. There are several SDL wrappers for Ruby available, I picked RUDL because of its simplicity. RUDL is great …

Web Development ruby
0
296
Member Avatar for iamrashid

Hi there is the code for floating some thing (menus image or what ever you want).You can set an specific location for the floating item and when you web page is scrolled down or up the object will float to that position slowly or fastly as you set them, just …

Web Development javascript
Member Avatar for iamrashid
0
134
Member Avatar for Electrohead

Example of using INCLUDE to show a nav bar. For beginners. Simply uses include to show an external file (in this case, nav.php) and that's it! You can also include this in another page with a CSS style. The CSS will be automatically included in formatting the INCLUDEd page! :D

Web Development php
Member Avatar for Dani
0
148
Member Avatar for Troy

class_http.php is a "screen-scraping" utility that makes it easy to scrape content and cache scraped content for any number of seconds desired before hitting the live source again. Caching makes you a good neighbor! The class has 2 static methods that make it easy to extract individual tables of data …

Web Development caching php vbscript web-browser xml
Member Avatar for Samir
0
347
Member Avatar for Troy

class_db.php is a database class that provides methods to work with mysql, postgres, and mssql databases. Other database types can be easily added. The class provides a common interface to the various database types. A powerful feature of the class is the ability to cache datasets to disk using a …

Web Development caching mssql php vbscript xml
Member Avatar for ethen_th
0
223
Member Avatar for JRED

This code snippet will attempt to show newbies to php how to connect and retrieve data from a PostgreSQL Database Server using PHP.

Web Development php postgresql
Member Avatar for Troy
0
194
Member Avatar for corewizard
Member Avatar for Drew

Learn how to loop anything you want sertain number of times. In this example im gonna show you a simple next and loop that changes the font size.

Web Development asp
0
95
Member Avatar for Drew

This is a neat little script that will tell you how many active users you have on your site. You do need a webhost that supports the global.asa file! Most free hosts dont. [B]Code From: [URL="http://http://www.iportalx.net"]http://www.iportalx.net[/URL][/B]

Web Development asp
0
140
Member Avatar for Scribbller

Allows a user to login to an ftp and upload files.

Web Development php
Member Avatar for forgotteneagle
0
193
Member Avatar for vegaseat

Shows how to connect a button onclick event to a javascript function to change the background color of the document. Just cut and paste the code into Notepad or other editor, save as BGchanger.htm and run it on your browser.

Web Development javascript
Member Avatar for Mohan0704
0
191
Member Avatar for vegaseat

Swap two images as you move your mouse in and out of the image field. Uses onMouseOver, onMouseOut and a short javascript code.

Web Development image javascript
Member Avatar for almostbob
0
171
Member Avatar for Gandalf

[b]1. mod_rewrite se friendly pages for vBulletin[/b] Here is a seo hack for vBulletin developed by Danielle Horowitz. You can find original text at [url="http://www.daniweb.com/techtalkforums/thread9379.html"]http://www.daniweb.com/techtalkforums/thread9379.html[/url] I have remade her instructions in the phpBB mod like format. You can read them here [url="http://www.daniweb.com/techtalkforums/post87148.html#post87148"]http://www.daniweb.com/techtalkforums/post87148.html#post87148[/url] You can download text file here [b]2. Meta …

Web Development php phpbb vbulletin
Member Avatar for didier-fr
0
483
Member Avatar for Dark_Omen

Okay, this introduces two new things into the widget. The first thing you need is a picture file (.jpg, .png, .bmp etc...). The new code makes the picture into the button with the text "Hello, World" on the side. In the parentheses next to File.open you would put the file …

Web Development ruby
Member Avatar for bumsfeld
0
146
Member Avatar for Dark_Omen

This is kind of an extension to my previous code snippet. This language is really fun to use. I find it pretty easy to use and understand. This will create a window with a button.

Web Development ruby
Member Avatar for bumsfeld
0
333
Member Avatar for Dark_Omen

This is a basic window coded in Ruby. To download Ruby go to [url]www.ruby-lang.org[/url] and download the latest version. The latest version includes the FX toolkit that is needed to create this window.

Web Development ruby
Member Avatar for Dark_Omen
0
234
Member Avatar for Scribbller

A server side generated 301 redirect for a permenantly moved URL

Web Development php
Member Avatar for dap62
0
97
Member Avatar for vegaseat

You probably have seen those message snakes following the cursor on a web page. Well, the javascript code is not too complex, so let's look at it ...

Web Development javascript
0
113
Member Avatar for ReDuX

Ok, this is about as simple as it gets. This is a hit counter for your page that stores the count in a simple text file of your choosing. No need for a database, MySQL or otherwise. No complicated rubbish. Just one single function and one single file to store …

Web Development php
Member Avatar for DaveSW
0
143
Member Avatar for ReDuX

Well like my previous snippet but completing the collection i suppose, this snippet counts how long it takes to parse the page and displays it somewhere..

Web Development php
Member Avatar for mohamed badr
0
167
Member Avatar for ReDuX

You've seen those sites that say how many seconds it took to parse the page and how many database queries comprised the page. Well heres the database query bit...

Web Development php
Member Avatar for klinke
0
239
Member Avatar for vash shadows

Put it in you footer at Admin CP->Board Wrappers, and underline will disappear for username links. This code only makes sense when you have underline enabled for links in your CSS.

Web Development javascript
Member Avatar for peter_budo
0
170
Member Avatar for vash shadows

Have you ever wanted an arcade for your forum? Well now you can! The best part is you can play the games from x arcade at your forum, and not at some site! The instructions are easy to understand, and in no time you will have an arcade! Unlike If …

Web Development javascript
Member Avatar for Starnova
0
141
Member Avatar for vash shadows

Add to....Board Wrappers: Footer No need to really change anything in the code, if you want to select a different default URL just change the variable in the top of the script. It's there so that at least some URL is added to the website url field. You can't add …

Web Development javascript
0
148
Member Avatar for dazzlindonna

If query is called getResults and your field name is called myField To change to 2-across or 3-across, or whatever, just change the MOD 4 to 2 or 3 or whatever number you wish.

Web Development coldfusion
0
114
Member Avatar for dazzlindonna

Change Your_Query to match your query name, Your_data to match your field name(s), and change the colors (ffffff and dadada) to match the colors you want.

Web Development coldfusion
0
148
Member Avatar for dazzlindonna
0
108
Member Avatar for dazzlindonna

Change the yourActionPage.cfm to the name of the page you want to open, and adjust the sizes and other parameters as you need.

Web Development coldfusion
0
185
Member Avatar for Drew

Learn how to take the Now() command and format it in a bunch of differnt ways. [B]Code from: [URL]http://www.iportalx.net[/URL][/B]

Web Development asp
-1
325
Member Avatar for Syneticus

Alrighty! My goal here is to add the specified information into a MySQL database, but then also include a script that goes back and checks to make sure that the entrie given does not already exist. If you have any corrections, or any ideas on how to do this, I'd …

Web Development php
Member Avatar for Ginetta
0
109
Member Avatar for DanF

Hi, this is my first post here, just wanted a place to post some PHP code for a Savant2 plugin I created. I hope that's ok. If you've never heard of Savant/Savant2, you should definitely visit its website. Savant is a very elegant template solution for PHP that stands out …

Web Development php
Member Avatar for Dani
0
148

The End.