-
2009
-
January
-
Clean our odd characters pasted from word to form fields (javascript version)
01/21/09
Here is the javascript version to clean out odd characters pasted from word into form fields:
function html_fix(html) {
html = html.replace(/<\\?\?xml[^>]*>/ig,"");
html = html.replace(/<\/?o:p[^>]*>/ig,"");
html = html.replac -
Cleaning out odd characters and multilingual characters when copyed from Word into your form fields
01/21/09
If you need to convert from one encoding type to another: this helps when certain multi-lingual characters don't show up properly on your browser.
$content = iconv("ISO-8859-1","UTF-8", $content);
Here is a function that cleans out odd characters and -
Create a dynamic rss xml feed with php class
01/19/09
class RSSFeed {
// VARIABLES
// channel vars
var $channel_url;
var $channel_title;
var $channel_description;
var $channel_lang;
var $channel_copyright;
var $channel_date;
var $channel_creator;
var $channel
-
Clean our odd characters pasted from word to form fields (javascript version)
-
January
-
2008
-
November
-
Ajax calls using prototype
11/04/08
Protoype is an excellent javascript framework that provides an easy way to make ajax calls.
Here is the sample code of how to make the call:
//first I am passing a variable that I call id, this would be the row id for the database table being used, for example: if I'm upda
-
Ajax calls using prototype
-
June
-
Form Select State & Show current selection
06/13/08
In this very basic example, the form is going to the same page on submit, assigning the state value to a session and showing the current selection in the drop down.
<?php
$_SESSION['STATE'] = $_POST['STATE'];
$temp_st = "type".$_SESSION[
-
Form Select State & Show current selection
-
February
-
Validating numbers
02/12/08
var digits="0123456789"
var temp
if (form.SSN3.value=="") {
alert("Please enter your Social Security Number.")
form.SSN3.focus();
return false;
}
for (var i=0;i<form.SSN3.value.length;i++){
temp=form. -
Date drop down for PHP forms
02/12/08
// created by www.dpwebservices.net
function listbox_day ($name, $default=0) {
$result="<select name=\"$name\" size=1 class=\"submit\">\n";
for ($dayf=01;$dayf<=31;$dayf++) {
if ($default == $dayf) {$selected=" -
Select between two dates
02/12/08
A few hints when dealing with "between date" searches, these are corrections to oracle manuals that don't tell you to handle this properly:
SELECT *
FROM
Your Table
WHERE
DTM_COLUMN BETWEEN TO_DATE('03-01-2006', 'MM-DD-YYYY') AND TO_D -
PHP Dynamic Variables
02/12/08
Simple PHP code of the day....
Example Scenario: Let's say you have multiple loops coming out of the database, and you are adding "checked" to specific checkboxes.
Normally you could just do something like this:
$temp = "myVarName".$i;
-
Disable print screen
02/12/08
<html>
<head>
<script language="Javascript">
function setClipBoardData(){
setInterval("window.clipboardData.setData('text','')",20);
}
function blockError(){
window.location.reload(true);
-
Clear present browser history
02/12/08
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<SCRIPT LANGUAGE="JavaScript">
function myhistory(url) {
if (document. -
Convert size of file to the largest unit
02/12/08
function convert_size($size)
{
$filesizename = array(" Bytes", " KB", " MB", " GB", " TB", " PB");
return round($size/pow(1024, ($i = floor(log($size, 1024)))), 2) . $filesizename[$i];
} -
Send Email with PHP
02/12/08
$subject = '';
$message = '';
$header = 'MIME-Version: 1.0' . "\r\n" .
'Content-type: text/html; charset=iso-8859-1' . "\r\n" .
'From: John Doe <no-reply@dpwebservices.com>' . "\r\n" .
-
Ajax example
02/12/08
function ajax_get(ctnid) {
if (ua.indexOf('msie') != -1) {
ajax_get_request = new ActiveXObject("Msxml2.XMLHTTP");
} else {
ajax_get_request = new XMLHttpRequest();
}
ajax_get_requ -
Welcome!
02/12/08
This blog will contain sample code for PHP, javascript and flash.
-
Validating numbers
-
January
-
Cross browser fix to open or close table rows, tables or DIVs
01/20/08
function showHide(id) {
sel = document.getElementById(id);
if (sel.style.display == '') {
sel.style.display = 'none';
} else {
sel.style.display = '';
}
}
</script>
Instead of using "b
-
Cross browser fix to open or close table rows, tables or DIVs
-
November
Calendar


