Praise be to Allaah.
The Prophet (peace and blessings of Allaah be upon him) spoke the truth when he said, I am not leaving behind any fitnah (trial, temptation) more harmful to men than women.(Reported by al-Bukhaari, 4706).
He (peace and blessings of Allaah be upon him) also said: This world is sweet and dazzling, and Allaah has you put in charge of it to see how you will do and what you will do, so beware of this world and beware of women, for the first fitnah (temptation, trial) that befell the Children of Israel was concerning women.(Reported by Muslim, 4925).
You have to deal with two things, one now and one in the future. As far as your past misbehaviour is concerned, you must repent sincerely to Allaah right now, and do good deeds to expiate for your bad deeds, as was reported in the hadeeth of Ibn Masood (may Allaah be pleased with him), who said that a man kissed a woman [who was unlawful for him]; he came to the Prophet (peace and blessings of Allaah be upon him) and told him about it, [saying, I met a woman in the garden, and I embraced her, touched her and kissed her]. [Here I am, judge concerning me as you wish.] [He started asking how he could expiate for this, and (the Prophet (peace and blessings of Allaah be upon him)) did not say anything]. Then Allaah revealed the words (interpretation of the meaning): And perform al-salaah at the two ends of the day and in some hours of the night. Verily, the good deeds remove the evil deeds [Hood 11:114]. The man asked, O Messenger of Allaah, is this just for me? He said, It is for all of my ummah(reported by al-Bukhaari, 495; additional material in brackets is from the reports of al-Tirmidhi, Ahmad, Muslim and Ibn Maajah, in that order), so do a lot of acts of worship and good deeds, so that Allaah may accept your repentance.
As far as the future is concerned, you are not permitted at all to go to places where there is corruption and free mixing, where you are likely to meet women. You say that you cannot control yourself, so why do you go to places where you spend time chatting informally with women, and then say that you cannot resist? What you say is completely unacceptable. If you avoid the places and things that lead to evil, and do not expose yourself to it, you will protect yourself from falling into sin. Fear Allaah, for Allaah is watching you to see how you will do and what you will do. Beware of going to places that will lead you into haraam things. Remember that the more you indulge in haraam activities, the more difficult it is to retreat, so nip it in the bud. Stick to righteous company, and keep away from evil things and evil people. Do everything that will help you to remain chaste, such as hastening to marry and lowering your gaze. I ask Allaah to protect you from the temptation of women. May Allaah bless our Prophet Muhammad.