Category Archives: Web Development

Anything web development stuff!

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 “config.inc.php” of the phpmyadmin folder and look for the lines that say:

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

change it to:

$cfg[‘Servers’][$i][‘AllowDeny’][‘order’]
// Host authentication order, leave blank to not use
= ‘deny,allow’;
$cfg[‘Servers’][$i][‘AllowDeny’][‘rules’]
// Host authentication rules, leave blank for defaults
= array(
‘deny root from all’,
‘allow root from localhost’,
‘allow root from 192.168.0.4’ // 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 “127.0.0.1” removing the # number sign.

Reload the page and the error should now disappear.

Babayu!