331 Reusable Code Snippet Topics

Remove Filter
Member Avatar for
Member Avatar for sun-tzu

I just made this code today for a site I'm working on and figured people may try to improve it. To use: [CODE] $("#randomize").randomize(); [/CODE] [CODE=HTML] <!DOCTYPE HTML> <html> <head> <title>Random Pick Test</title> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.js"></script> <script type="text/javascript" src="randomize.jQuery.js"></script> <script type="text/javascript"> $(document).ready(function() { $("#randomize").randomize({ direction: 'topToBottom', evenBG: '#FFF', evenFG: '#000', …

Web Development javascript javascript-jquery
Member Avatar for Taywin
0
705
Member Avatar for kudosvisions

[B]Hi Guys.[/B] I am new to this forum so I thaught i'd post a useful code snippet. it changes text to clickable html links. Hope it comes in handy. Pete:)

Web Development asp
Member Avatar for pecp
0
198
Member Avatar for kevin wood

this code will delete all the files from a directory on the server. be careful when using this as it will delete everything in the directory so use it wisely or make sure you have backups if it is implemented on the wrong directory. it works by searching for all …

Web Development php
Member Avatar for smithdp1
0
244
Member Avatar for broj1

I have prepared an example of login page which displays a form with inputs for username and password and compares submited values with records in database. If match is found the user is redirected to another page, if not error message is displayed. This example is heavy commented. Hope it …

Web Development mysql php
Member Avatar for broj1
3
778
Member Avatar for igotdreams

Would you like to know when the Google spider or any other spider comes by your site? Well now you can with this handy snippet. It will send you an email for everypage it visits.

Web Development coldfusion
Member Avatar for jsmall26
0
162
Member Avatar for tlox

Hello everyone. i have a student database, from which i search a student by entering the student ID at the web interface.Im using a repeater to display search results. Within this repeater i have a link button that should redirect to a page that will display full information about the …

Web Development asp.net
Member Avatar for asemoonabi
0
2K
Member Avatar for metalix

View the full tutorial at [URL="http://www.effectivewebdesign.co.nz/tutorial.php"]http://www.effectivewebdesign.co.nz/tutorial.php[/URL] I have tested this many times and it works fine. Please don't complain unless you really can't get it working, Just PM me and I'll fill in the blanks Happy Coding :)

Web Development mysql php sql
Member Avatar for Rogueit
0
883
Member Avatar for Luckychap

I have seen many beautiful clocks using images and and canvas and flash. So I thought of developing one with pure HTML,CSS3 and javascript, no images at all. This clock can be completely design using CSS. A brief description of Javascript used:- 'AnalogClock' is the name of the class which …

Web Development html-css javascript
Member Avatar for Luckychap
0
478
Member Avatar for Luckychap

This is my first step towards HTML5. This is currently tested on Chrome browser where it is awesome. It will not work on FF and definitely not on IE. I am working on it. Just copy-paste the code in blank html file and run on chrome. 'Scroller' is simple menu …

Web Development html-css javascript
Member Avatar for Luckychap
0
1K
Member Avatar for iau

I wish it show as unfulfilled:bb,cc extra provided:dd as my conditions and provided strings will be unconstant, anyone can suggest me some ways to do it?

Web Development php
Member Avatar for diafol
0
254
Member Avatar for kha_tsn

This code is to generate excel with grid lines in it with file name as you given in the code which will disply when you opening throug the download dialog box, Regards, khaleel

Web Development coldfusion
Member Avatar for ngabach
0
467
Member Avatar for iamthwee

[CODE]// create two new instances of LoadVars, one to send and one to receive data var dataOut:LoadVars = new LoadVars(); var dataIn:LoadVars = new LoadVars(); // define what should happen when the response is received, // using 'this' to refer to dataIn and get data from it dataIn.onLoad = function() …

Web Development php
Member Avatar for iamthwee
0
437
Member Avatar for Troy

Does your organization use Microsoft Exchange? Do you have a need to incorporate your Exchange data with your PHP web applications? You can use the WebDAV methods to query your Microsoft Exchange Server using the PHP scripting language. Once you wrap your brain around these techniques, the sky is the …

Web Development php
Member Avatar for dskanth
0
2K
Member Avatar for Troy III

Since the Firefox [Bug 633133] of the [B]in[/B] operator on DOM Collections has ben finally fixed - We can now write a short fast and clean function of the method "Contains" for FirefoX to check if x.contains(y). And vice- versa. What we will need is: a prototype and we'll chose …

Web Development javascript web-browser
Member Avatar for Troy III
0
633
Member Avatar for anilashanbhag

The script is used in my newest chrome app [url]https://chrome.google.com/webstore/developer/detail/bomkcodcgmbjjhogdjophonfhgpegoni/[/url] Site: [url]http://codestrix.co.cc/pixels/[/url] The above script is a good to get stated with HTML5 canvas. Much of it is named so as to be self explanatory but any doubts you are more than welcome to post it here.

Web Development html-css image javascript
Member Avatar for anilashanbhag
1
661
Member Avatar for Luckychap

This is Jquery plugin which can be used to change the content a its place. Features: 1. Easy to use 2. Maintain changeability of Jquery Know Issue: 1. Can take html string also as input For example: html: [code=html] <div id="editable">I can be changed right here</div> [/code] javascript: [code=javascritp] $.('#editable').editAtPlace(function(newtext, …

Web Development javascript javascript-jquery
0
361
Member Avatar for G_Waddell

Hi I thought I'd share this with you all as it is really quite simple but I spent ages looking for it. I have an ASP.Net App with a master page containing a tree view that holds a heirarchy of data (as opposed to site naviagation) What I wanted was …

Web Development asp.net
0
663
Member Avatar for pinkygirl

Hello. This demo shows how to upload multiple image files, saving them in "Image" folder and displaying them all. To do this, create a folder named "Image" in your solution explorer. I hope you like it :)

Web Development asp.net
0
685
Member Avatar for Graphix

Hey everybody, Lately I have written the game Hangman in many different languages (C, JavaScript, Java and PHP so far). Here is the code snippet for PHP! It uses a words file, on the bottom of this post you will see a small example of a few words. The source …

Web Development php
Member Avatar for Nick Evan
0
2K
Member Avatar for Krstevski

Hello friends, now I will show you how to make a simple anti spam protection (without using captcha) who is very effective. The original idea (for educational purposes) is taken from here: [URL="http://delicon.mk/blog/kontakt-formular-koj-ne-saka-spam-botovi/"]Part 1[/URL] [URL="http://delicon.mk/blog/kontakt-formular-koj-ne-saka-spam-botovi-2/"]Part 2[/URL] Sorry about the links and macedonian language, but I respect my friend and I …

Web Development php
Member Avatar for TechySafi
0
1K
Member Avatar for ApocDen

the code is very simple and all it does is get the ip of a member or guest and logs it in a text file. if the log.html doesn't exist it will auto create one for you, as long as the path is correct. Also make sure you set proper …

Web Development php
Member Avatar for TechySafi
0
1K
Member Avatar for Wraithmanilian

This code is for a stand-alone file, named "thumbnail.php" or something similar. Once uploaded to your server, it can be called from inside an IMG tag. There are four options for this script without modifying anything. [LIST=1] [*]First, you can resize the image to a percentage of the original, as …

Web Development image php
Member Avatar for Web Dev Rob
0
378
Member Avatar for dazzlindonna
Member Avatar for jsmall26
0
199
Member Avatar for Brianbc

[CODE]<?php /* +-----------------+------------------------------------------------------------+ | Class | setup | | Author | Brian Onang'o | | Version | 1.0 | | Last Modified | 10:16 AM 10/2/2010 GMT+3 | +-----------------+------------------------------------------------------------+ | This program is free software; you can redistribute it and/or | | modify it under the terms of the GNU …

Web Development mysql php
Member Avatar for Brianbc
0
239
Member Avatar for ApocDen

This is a very simple bbcode example to use on a forum or your pages. Add this to a function page and make sure the function is required on the page you want to on. ENJOY!! :D

Web Development php
Member Avatar for phplover
0
391
Member Avatar for nirveshverma

hey buddies:) here is login page for begining purpose in asp.net i hope you will enjoy it and it is expected there is some mistakes also so please feedback it. Thanks

Web Development asp.net
Member Avatar for umamahesh2020
0
155
Member Avatar for aditya61

The above code will get the user information from page "getuser.php". The output of getuser.php has some numericals populated in 5 rows. The 6th row i.e., the table footer has the sum of all numericals populated in the above 5 rows. The numericals in the first 5 rows are populated …

Web Development javascript xml
Member Avatar for scrappedcola
0
312
Member Avatar for DealthRune
Member Avatar for kamotekid08
1
295
Member Avatar for rajesanthu

[COLOR="Red"]NB:Excuse me Experts,,,This is only for beginners......[/COLOR] [COLOR="Green"]JAVASCRIPT FOR CHECKING WHETHER THE TEXT FILED IS FILLED OR NOT[/COLOR] Be noted that 1.The form given above is just for example 2.You can add your own form,,please dont forget to chenge the names in assignments as you are going on your own …

Web Development javascript
0
212
Member Avatar for snehalj

above code not working, y is 2010 and year0 is also 2010, as per my knowledge Equal should be displayed as output, but the condition does not get equal. Pls help me for this.

Web Development asp
Member Avatar for snehalj
0
553
Member Avatar for php4ever

I absolutely hate it when I trust a person and never collect a deposit on work only to NOT be paid when I'm done. I recently designed a flash page turn effect that is all XML controlled for a Realtor where the agents could simply upload the images to a …

Web Development php
Member Avatar for dennishall
0
152
Member Avatar for NicAx64

well PHP is a powerfull text processing language designed mainly as a CGI ( common Gateway Interface ) programming language. But PHP supports rest of other features using the library extensions. For a example you can call any win32 API call in your PHP script using the win32 API library …

Web Development php
Member Avatar for psharma
0
702
Member Avatar for preetg

hi...... i am using window xp.....apache server m new in php i inserted record in database through forms .now i m facing problem to delete the records from database in php code..... above code is not working properly...give me solution within 2 days....

Web Development html-css php
Member Avatar for didier_m
0
416
Member Avatar for digital-ether

The above classes provide an interface for reading the PHP session data. PHP alone only gives you access to the current users session. This class allows you to read all session files, and thus allow you to read session data across different users. This may be useful if you want …

Web Development php session
Member Avatar for digital-ether
2
1K
Member Avatar for serkan sendur
Member Avatar for Taywin
-1
96
Member Avatar for mikeandike22

this application shows you how to declare variables and display variables. the end result of this code is showing you the total price after tax. this is mainly for beginners.

Web Development coldfusion
Member Avatar for jsmall26
0
89
Member Avatar for ApocDen

This will count number of page views in a session. Simple, to add on the page just add the code on the top of the page and make sure it is before any html.

Web Development php
Member Avatar for kyrilkong
0
1K
Member Avatar for Airshow

[B]INTRODUCTION[/B] Have you ever wanted to pass data from one web page to another when server-side scripting is unavailable, and without setting a cookie? Ever wanted an efficient way to build url query strings? Well now you can. [B]SOLUTION[/B] It is maybe little realised is that data can be successfully …

Web Development javascript
Member Avatar for jadhav vijay
2
1K
Member Avatar for ShawnCplus

This is about as simple as it gets with menu generators. Everything is explained in the code. Note that the menu is simply an unordered list so to pretty it up it really relies on the CSS. If you don't want to write any CSS of your own here is …

Web Development php
Member Avatar for TonyAR
0
733
Member Avatar for digital-ether

A very simple MySQL database class. [B]Usage:[/B] [CODE]// connect $config = array( 'host' => $host, 'user' => $user, 'password' => $password, 'database' => $database); $DB = Database_MySQL::getInstance($config); // set query $DB->query("select * from table1 where col1 = %d and col2 = '%s' LIMIT 1", 5, 'a'); // get rows $rows …

Web Development mysql php
Member Avatar for benjaminFowl87
0
238
Member Avatar for TheVenerableZ

I made a PHP class that dramatically simplifies sending text messages with PHP. I know this isn't really a "help me out!" type question per se, but I would like to share the code because I have found it to be tremendously useful. You're free to do whatever you'd like …

Web Development php
Member Avatar for ﻼim
0
2K
Member Avatar for ApocDen

This is a very simple WYSIWYG Text editor that only has three options Bold, Italic, and Underline. just copy and paste on the page you want it on. it is really easy to add more features. ENJOY

Web Development javascript ui-ux
Member Avatar for Taywin
0
350
Member Avatar for ApocDen

1. Imports System.IO 2. Create class "CreateThumbnails" or any class and place following function inside that class You need one function to response call back to main function Function ImageAbortDummyCallback() As Boolean Return False End Function

Web Development asp.net
0
566
Member Avatar for ApocDen

for this to work you need to add some text boxes and name them accordingly, make sure when you add a text box add [CODE]$_POST["new_text field"] = $new_text field;[/CODE] etc etc. html coding can be used within the html tags only.

Web Development email html-css php
Member Avatar for metalix
0
229
Member Avatar for Rkeast

I am posting this code snippet as I continue to see login and user registration scripts that store passwords in databases as unsalted md5 hashes, and passwords in cookies as raw text. This snippet includes an example user registration function, as well as an example user login, login check, and …

Web Development php
Member Avatar for metalix
0
519
Member Avatar for ApocDen

this snippet is to create random passwords with a chosen length and a specified number of numbers. Uses both lower case and capital letters, which are chosen at random. And example is: wep5Q268LtTe. [B][U]How to use.[/U][/B] Using this is very easy just add to the appropriate page and call the …

Web Development php
0
708
Member Avatar for DealthRune
Member Avatar for manzarr
0
226
Member Avatar for Troy

This is a PHP script that allows javascript clients to request content they otherwise would not be able to. With the popularity of AJAX (using the XmlHttpRequest object in the browser), many developers are becoming aware of the cross-domain scripting limitation. This is a security feature that prevents client-side scripts …

Web Development php
Member Avatar for umakantp
0
6K
Member Avatar for essential

A simple progress bar that you can addUp with some common events' like redirecting the user to another source. And while they wait let this progress bar do some work for them...

Web Development javascript
Member Avatar for israelvainberg
0
204
Member Avatar for dinkado

The code works perfect in IE but I can't get it to work in Firefox. Is there a work around for firefox? Your time and help are greatly appreciated. dinkado

Web Development javascript
Member Avatar for fxm
0
259

The End.