LAMP How To – Open Source At Work

Only Passion Matters

Entries for the ‘Think PHP’ Category

sending data via url securely

Depending on your situation, sometimes it is quicker to append form data to urls. To do this securely, we need to encrypt it and decrypt it later. One good solution is to use mcrypt.
We can create a class like so:
class Encryption {

 var $skey  = “your own key”; 

    public  function safe_b64encode($string) {

        $data = base64_encode($string);
        $data = [...]

Quick tips for setting up Eclipse and Monkey

eclipse-pdtis a php integrated eclipse IDE – good for rapid web development.
download eclipse-pdt from above.
setup subclipse (for svn) if you intend to use svn within eclipse. In eclipse->help->software updates->available software->add site, enter URL: http://subclipse.tigris.org/update_1.6.x
Another good software to install is beyond cvs. In eclipse->help->software updates->available software->add site, enter URL: http://beyondcvs.sourceforge.net/update/0.8.x/

 

install subeclipse and javaHL adapter.
setup eclipse monkey [...]

Quick SVN Tutorial

Create New Repo
svnadmin create /home/data/svn/[dir-name]
chown apache:developer -R /home/data/svn/[dir-name]
chown 2770 /home/data/svn/[dir-name]

Import New Site

ssh into server
to import new site to the trunk,

svn import [your-site] file:///home/data/svn/[your-site-name] -m “[import comments]”

View Available Sites In Trunk
svn ls file:///home/svn/trunk/

Checking Out a Site

Create a directory to checkout and use ’svn co’

cd ~
mkdir [my-site]
svn co file:///home/svn/trunk/[site-name] [my-site]

Updating a [...]

submitting a form using hyperlinks

If using hyperlink to submit form, remember to return false in “onclick” so that it is backward compatible with IE6, ie
<a class=”button_next” href=”javascript:;” onclick=”$(‘#form_wizard’).submit();return false;”>
<span>Update</span>
</a>

resolving jquery conflict with other javascript libraries

It is good to know that jquery can work with other js libraries…
Just need to know how to resolve the conflict
http://api.jquery.com/jQuery.noConflict