How can i detect if my player is standing or walking over a platform(Cube) ?

I have a cube and i control the player(ThirdPersonController) and when i move it over the Platform(Cube) i want something to happen. I want to detect when the player is standing or walking on the Cube on it’s top. Not from sides or under but on top of it.

Here is a screenshot of the player standing on the Cube i renamed it to Platfrom:

This is my script attached to the Platform:

using UnityEngine;
using System.Collections;

public class DetectPlayer : MonoBehaviour {

    void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject == transform)
        {
            Debug.Log("On Platform !");
        }
    }
}

But nothing happen when i move the player on the Platform.
It should show the Debug.Log

I’m not getting warnings or errors.

UPDATE:

I removed the script from the Platform and attached it to the ThirdPersonController i also changed the script to this:

using UnityEngine;
using System.Collections;

public class DetectPlayer : MonoBehaviour {

    void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject.name == "Platform")
        {
            Debug.Log("On Platform");
        }
    }
}

Now when the player hit the Platform i does show the Log “On Platform”.
But now how do i know if the player is on/above the platform and not only hit it ?
I want to know if the player hit it from above when he stand on the Platform and not hit it by accident from the under or sides. Only when it’s on the surface of the Platform.

You have to attach the script to the player and to the

void OnCollisionEnter (Collision other)
{
if(other.gameobject.name==“Terrain name”)
{
//code here
}
}