How can you get curtain rods to stay in place if there is no hole in the bracket to secure the rod into the bracket?

You can insert two screws or nails in the back of the rod for each bracket to prevent the latter from moving left or right. the space between the screws should be the same as the width of the bracket.