Teleportation Coordinates Question [duplicate]

How do I make a teleporter that doesn't need a pressure plate to activate?

In other words I would like to execute a command which is executed when one steps in a certain location. For example, a command that would test if someone is somewhere and then teleport them somewhere else.

I have a few ideas, but I do not know how I know to complete the assignment. Maybe these commands?

/execute <playername> ~ ~ ~ /tp <playername> ~ ~ ~
/execute <playername> ~ ~ ~ /fill ~ ~ ~ ~ ~ ~ minecraft:redstone

Solution 1:

The /execute command only needs to be used when the command sender or origin of execution needs to change, which is not the case here.

The selector parameters x, y, and z for coordinates, and r for radius, will be included in the selector for /tp. For example, the following teleports players who are within 1 block of (10, 64, 10) to (15, 64, 15).

/tp @a[x=10,y=64,z=10,r=1] 15 64 15