Archives 

Show All

  • 2009
  • 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

    • 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[�

    • 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.

    • January