Why the pressure in liquids only depends on the height? look at this picture :

and also look at this one:

imagine that the surface area of both is the same and both of them are full of water.
My question is that why they both are pressing the beneath surface of the containers with the same pressure due to  $$ P=\rho . g .h$$
?
 A: Since you have an equilibrium situation the net force on any portion of the water is zero.

In region $B$ the horizontal forces acting on the water are either provided by the walls of the container in the left-hand diagram of by the water in regions $A$ and $C$ in the right-hand diagram.
So as far as the water in region $B$ is concerned it makes no difference as to whether it is contained by the vertical walls of a container or vertical walls of water (regions $A$ and $C$).
In both cases for region $B$ the weight of the water in region $B$ is supported by the upward forces due to the bottom of the container.  
So what supports the weight of the water in regions $A$ and $C$?
It is the vertical component of the force exerted on the water in regions $A$ and $C$ by the sloping walls of the container.
A: Many ways of looking at this:


*

*If there were any differences in pressure in horizontal direction, the pressure difference would mean a force that would induce motion of the fluid until the pressure difference would drop to 0. So in stationary state, pressure must be constant horizontally, and vertically, the difference in pressure between different heights must be exactly equal and opposite to the force of gravity on the liquid between. That is, $p=\rho g h$.

*However wider or narrower the top part of the vessel is, the difference (more liquid on top than on bottom) is held up by the diagonal walls, so whatever liquid hangs over the edge, does not change pressure on the bottom but on the walls (of course, it's again more force on the bottom part of the wall than on the top, according to the above formula).

*Imagine putting a vertical tube (sleeve or a sock, or a glass cylinder) into the water. It won't push the sock walls to the side, the floppy sock and glass cylinder will both just have water inside that behaves just as before we put a sock around it, whatever happens outside (you can do this in the ocean, where you don't know the shape from where you stand). The point is... there is no way the water could know what's outside. It's liquid... the physics only depends on the local equilibrium of forces, it cannot depend on what's going on far in other parts of the container. Things are different when liquids flow and move and transmit sound waves and so on... but in stationary liquids, you have local equilibrium of forces.

*Similar to 3, but... put a small bucket into a large bucket. Poke a small hole. The water will flow until the pressures are equal. Now... plug the hole back in. Did anything change for the fluid? Nothing. So... before you plug the hole, the water was (technically) in the larger bucket (with diagonal walls) and when you plug the hole, the water inside the smaller bucket is independent from the outside, but it doesn't make a difference.
A: I cannot comment (yet) - that is why I have to ask via an answer...
Please let me know if I understand your question right:
You want to know why the pressure on the lower, inner surface of the bucket is the same, considering that there is more water in the bucket with the inclined side surfaces...  
If this is your question think about that:
There is more water - yes - but there is also an increased side surface ("taking more force from the water")
In the extreme case that the angle between bottom and side goes in the range of 90° - you will see it more clearly (always keep in mind to fill the water in your head to the same height :-)  
Just tell me if that helped
Kind regards
Andi
A: Because a Newtonian liquid's molecular characteristics, they tend to possess a definite volume without any specific shape. The important aspect is the height of the liquid not the shape of the container. If the height of a liquid with a specific gravity of 1 is 2.31 feet high (rounded off), The weight of that column is one pound over an area of 1^2 inch. Thus,
P(PSI) = (H/2.31) or more exactly, (H * SG)/2.31 for any Newtonian liquid at any temperature and any specific gravity.
