Bootstrapping – Relative Path trailing slash / (PHP)

When developing a site with bootstrapping in mind, (by the way bootstrapping is a technique in web development when all request gets directed to one page that is usually index.php for example a request to page, , etc. is handled by index.php with the help of a mod_rewrite script in the root directory. And creates a slug url for SEO.) when this is done an issue will occur relating to relative path and pointing to static files in your site such as images, css and scripts especially . Imagine this scenario:
Examine the file structure


When someone request a url from your site eg. “http://domain/user” and in the page your css points to “css/style.css”, your page will come out alright but when they add a slash at the end “/” “http://domain/user/” like so, your browser will interpret the slash as a folder location to “user/” so if your path to your css is “css/style.css”, your browser will look for the file in “user/css/style.css” which in this case the folder doesnt exist and so your website will come out really messed up.

So remember to fix this when you are developing a site based on bootstrapping. You can fix this either by .mod_rewrite or simply via your PHP script by checking the trailing slash at the end from the REQUEST_URI variable.
Until next time.

JQuery Plugin Must haves

As I am currently working on a website right now. And Im using JQuery as my javascript library and its the way to the future when it comes to DHTML and this accompanied with plugins that are useful to make developing easy and fun. Here are the plug ins I use for my reference your and yours.

* JQuery Form Submit
This will let you submit forms via AJAX automatically that can save you time doing AJAX. This also lets you upload files via ajax and its pretty daunting doing file upload via ajax.

*JQuery Text Resizer –
This allows your text area to be resizeable its pretty easy to set up.

I will update this list regulary once I come across other useful plug-ins.

PHP Header Function – Redirect – Exit

I was developing my site when something weird happened , mostly sessions get UNSET in the end of my php script, but when developing In the middle script a redirect function like the “header(‘location: http://mydomain/etc’);” I assumed once redirected the any script below it wont run anymore but I was wrong.

Then as soon as the header function has been called, the script below it ,has triggered as well while performing redirect. At first I didnt know what was wrong with it until I just unknowingly added EXIT; after the header function and everything works fine.

So for my reference ALWAYS REMEMBER TO PUT an exit function AFTER the redirect function so that there wont be any weird issues developing your site along the way. Especially when your developing using PHP.

Allow phpmyadmin to be accessed from outside the network

When using WAMP server on windows and you like phpmyadmin to be accessed from the outside. Make sure you put wamp online first then go to C:\wamp\alias directory and open phpmyadmin.conf. Replace Allow by using your own IP or any IP that it can be accessed. Use comma for multiple stances. Or you could simply follow the instructions on there. Where it says to change to “allow from all” replacing “deny from all”.

Then head to “” of the phpmyadmin folder and look for the lines that say:

$cfg[‘Servers’][$i][‘AllowDeny’][‘order’] // Host authentication order, leave blank to not use
= ”;

change it to:

// Host authentication order, leave blank to not use
= ‘deny,allow’;
// Host authentication rules, leave blank for defaults
= array(
‘deny root from all’,
‘allow root from localhost’,
‘allow root from’ // Any IP your accessing the phpmyadmin from.

After that change the auth_type to ‘http’. Restart the server and you should be able to login now from the outside with authentication window asking for the username and password.

imagecopyresampled() PHP Function – Dummy Explained

You probably know this function needs to have GD enabled. If you dont know how just google how to enable it on your server.

Here is the function: imagecopyresampled(destination_resource,image_resource,destination_x,destination_y,src_x, src_y, destination_width,destination_height,src_width,src_height);

Run down below of the parameters:
destination_resource = destination resource is the container of the image, meaning this will be the final dimension of your image and contains the actual image, think of it as a canvas for your paint. When you output the image its the box that will render it. This usually comes from imagecreatetruecolor,imagecreate etc and other functions. specifing the width and height.

image_resource = is of course the resource image itself. Kinda like the paint you will use on the canvas this is the IMAGE you want to put on the container or canvas or the destination resource. This comes from imagecreatefromjpeg,imagecreatefrompng specifying the path to the image.

Now the rest of the parameters we usually do not understand.

Continue reading imagecopyresampled() PHP Function – Dummy Explained

Drupal 6* – HTTP Request fail status on WAMP

Lately I got this error when I freshly installed Drupal 6. I googled and google how to fix the problem.

All you got to do is navigate through your windows file system if your using windows look for the folder c:/window/system32/drivers/etc/ and open “hosts” file , you must be an admin to be able to change this file.

If you are running Windows vista/7 , right click on notepad and choose “run as administrator” and look for that hosts file. Uncomment the bit where it says “” removing the # number sign.

Reload the page and the error should now disappear.


3ds Max Creating Bones – Reference

Whenever I go to creating stuff on 3dsMax I always forget how the Bone works. Just for reference for me to remind me how this work and relearned the knowledge fast. Its also to remind me Bone System for animating models and Rigging is for applying IK Solvers and Kinematics to how the bone system will work.

To create a bone: – In the right side in the Create tab and at the very end of icons the System is where you will find the Bone. Its very straight forward to create click and click and right click to end creating your bone. – To Edit the bone and continue connecting , removing and deleting bones. You need to turn on your Bone Tools under Character menu in 3dsMax 7 or under animation in other versions.

Special Note: I often wonder how to connect bones and their orientation is done. Also how to connect 2 opposite adjacent bone together. This is done by linking the bones to the parent bone or it could also be a dummy shape. Use “Select and Link” to form a parent/child relationship with bones.

Heres a very useful video creating bone and character rigging for both our reference:

Illustrator CS3 – Coordinate mismatch and aligning guides accurately

When working with Illustrator CS3 and you find yourself , transforming and moving objects but the origin of the ruler doesnt match and way off from the document itself. All you need to do is DOUBLE CLICK the upper left hand WHITE SQUARE where the X and Y ruler meets.

And also with the guide to accurately position it you need to have transform window open via Window->Transform and adjust the X/Y coordinates to your needs.

2017 © Ideas, designs and algorithms