chmod 777 gives read, write and execute status to the owner, group members and the rest of the world on a file. It's unlikely that you want this.
The numbers after chmod are octal numbers that relate to three binay bits. So binary 110 gives octal number 6 and means read, write but not execute permissions.
There are more explanations here: http://gnuru.org/index.pl?node_id=746