Our Web Development forum encompasses all of the serverside and clientside technologies related to building and developing a website from the ground up.

333 Reusable Code Snippet Topics

Remove Filter
Member Avatar for
Member Avatar for Jessehk

This is a simple, but complete (pseudo) random password generator. Examples of usage: [code] $ ruby pgen.rb soovmuvytv $ ruby pgen.rb --length=20 bynnugipyeeghdbihcdn $ ruby pgen.rb --length=20 -n v3ji3awj1trzjlda5oax $ ruby pgen.rb --length=20 -np :sa6vafpummpttjp?qo: [/code] For complete usage guidelines, run [inlinecode]$ ruby pgen.rb --help[/inlinecode] This (hopefully) serves as both …

Web Development ruby
-1
192
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
458
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
319
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
201
Member Avatar for Member #36984

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
154
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 web-browser
Member Avatar for Samir
0
370
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 microsoft:sql-server php
Member Avatar for ethen_th
0
248
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
216
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 classic-asp javascript
0
113
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 classic-asp
0
159
Member Avatar for Scribbller
Member Avatar for forgotteneagle
0
195
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 html-css javascript
Member Avatar for Mohan0704
0
206
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 html-css javascript
Member Avatar for almostbob
0
198
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:vbulletin
Member Avatar for didier-fr
0
493
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
164
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
351
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
251
Member Avatar for Scribbller

A server side generated 301 redirect for a permenantly moved URL

Web Development php
Member Avatar for dap62
0
111
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
129
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
168
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 web-design
Member Avatar for mohamed badr
0
176
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 database-design php
Member Avatar for klinke
0
271
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.

Member Avatar for peter_budo
0
197
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 web-design
Member Avatar for Starnova
0
151
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
163
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
122
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 html-css web-design
0
161
Member Avatar for dazzlindonna
0
122
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
202
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 classic-asp html-css
-1
364
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 mysql php
Member Avatar for Ginetta
0
137
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:codeigniter
Member Avatar for Dani
0
159

The End.