Archive | Programming RSS feed for this section

The TRUTH about PHP/mySQL security Part I

So I finished a small application that I am using only on my computer to avoid any problems on the net in regards to security (name it hackers/crackers/enthusiast/whichever).

Since there is no easy way to ask a question like What is the best way to create a secure applicationI decided to send the question out there and ask to what everyone thinks or believes is a secure way to create their applications.

I have been working with PHP/mySQL as user not much as developer for the past years but now trying to learn more about the developer side, I have hit a wall once I have faced Security.

For a while I was certain that putting my sql connection in a PHP file it was ok, this believe was even stronger while using different applications out there that place their connections logarithms inside folders named as simple as connections, and if we want to examine this theory further if you create a Database Connection in Dreamweaver the application itself will create a folder titled Connections and inside that folder it will write the scripts necessary to connect to your DataBase.

With all this in mind I ran into a basic tutorial that highlighted the importance of having your connections secure and one recommendation was to place your connections script (or PHP file) under a password protected directory. This would be an overkill IMHO and not only that but securing a password with another password?

To Be Continued....

Open A Jump Menu in a new window

This is for Macromedia DreamWeaver, but it can be applied to any Jump Menu using the right JS function.

HTML:
    original:
    <select name="nameOfYourMenu" onChange="MM_jumpMenu('parent',this,0)">

    change to:
    </select><select name="nameOfYourMenu"
    onChange="MM_jumpMenu('window.open()',this,0)">

Fastes way to detect if a radio button has been selected

There are times when you just need to pull the default value of a radio button selection, rather than creating and array and testing from it.

The quick and dirty solution is to place a hidden field right before those items you want to send with default values if nothing is selected.

PHP:
    <input type="hidden" name="NameOfYourRadio" value="Default Value"/>

createTextField and removeTextField

ActionScript:
    createTextFieldOnce = function(){
       trace("---> Text Field Created");
       _root.createTextField("cMagnitude",this.getNextHighestDepth(),0,0,100,30);
       cMagnitude.text = "Hello World";
    };

    deleteTextField = function(){
       trace("----> Text Field Deleted");
       _root.cMagnitude.removeTextField();
    };
    createTextFieldOnce();
    setInterval(deleteTextField,1000);

Loading a RSS feed into Flash

ActionScript:
    // create a new XML object
    var sports:XML = new XML();

    // set the ignoreWhite property to true (default value is false)
    sports.ignoreWhite = true;

    // After loading is complete, trace the XML object
    sports.onLoad = function(success) {
      trace(sports);
    };

    // load the XML into the sports object
    sports.load("http://rss.news.yahoo.com/rss/sports");

Removiing a Movie Clip on Stage with AS

ActionScript:
    //A square with id = square
    //A simple button named mca that removes the attached MCs

    this.attachMovie("square", "square1",1);
    this.attachMovie("square", "square2",2);

    square2._x =100;

    mca.onRelease = function() {
     square1.removeMovieClip();
     square2.removeMovieClip();
    }

After a long brake

As many of you know, for a while I was away from message boards. but I am back to help a few of the newbies out there. Also I am looking forward to update the Flash Bits section along with the PHP and DW bits.

Create Text Field FlashMX 106 (lets have fun!)

ActionScript:
    hDistance = 20;
    vDistance = 0;
    buttonsInfo = new Array("About Us", "Contact Us", "Gallery One", "Gallery Two", "Gallery Three", "Visual", "Guest", "Clients", "Account", "Search");
    textDesign = new TextFormat();
    textDesign.font = "Arial";
    textDesign.size = 15;
    textDesign.bullet = false;
    textDesign.underline = true;
    textDesign.url = "http://www.helmutgranda.com/";
    for (i =0;i&lt;10;i++){
       this.createTextField("textHolder"+i, i, 120+(i*vDistance),120+(i*hDistance),100,19);
       this["textHolder"+i].text = buttonsInfo[i];
       this["textHolder"+i].border = true;
       this["textHolder"+i].borderColor = "0xaa"+i/2+i/2+i/2+i;
       this["textHolder"+i].html = true;   
       this["textHolder"+i].selectable = false;
       this["textHolder"+i].textColor = "0xaa"+i*2+i*2+i*2+i;
       this["textHolder"+i].setTextFormat(textDesign);
    }

Create Text Fields FlashMX 105 (with Borders)


hDistance = 20
vDistance = 0
buttonsInfo = new Array("About Us", "Contact Us", "Gallery One", "Gallery Two", "Gallery Three", "Visual", "Guest", "Clients", "Account", "Search" )
for (i =0;i<10;i++){
this.createTextField("textHolder"+i, i, 120+(i*vDistance),120+(i*hDistance),100,19);
this["textHolder"+i].text = buttonsInfo[i];
this["textHolder"+i].border = true;
}

Creating a Text Field FlashMX 103


hDistance = 20
vDistance = 0

for (i =0;i<10;i++){
this.createTextField("textHolder"+i, i, 120+(i*VDistance),120+(i*HDistance),100,19);
this["textHolder"+i].text = "hello Helmut " + i;
}