All perfect praise be to Allaah, the Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His Slave and Messenger.
Spitting in the direction of the Qiblah is forbidden. Huthayfah narrated that the Prophet said: ''Whoever spits towards the Qiblah, he will come, on the Day of Judgment, with his spitting between his eyes.” [Abu Daawood and others]
Also, Ibn Khuzaymah reported that Hadeeth from Ibn ‘Umar from the Prophet with the wording: ''The person who spits in the direction of the Qiblah will be resurrected on the Day of Judgment with his spitting on his face.”
Moreover, As-San'aani said in his book Subul As-Salaam: “Spitting on one's right is like spitting in the direction of the Qiblah: this is absolutely forbidden. 'Abdur-Razzaaq reported from Ibn Mas’ood that he disliked spitting on his right hand side while he is not in prayer, and Mu’aath ibn Jabal said: “I have not spitted on my right since I became a Muslim.” It was also reported that ‘Umar ibn ‘Abdul-Azeez forbade this as well.” [End of quote]
Mughni Al-Muhtaaj, which is one of the books of the Shaafi'i School of jurisprudence, reads: “It is disliked to spit on one’s right and in one’s front outside the prayer also as said by the author, contrarily to the preponderant opinion held by Al-Athra’i who is of the same view of As-Subki that this is permitted, but they disliked that if it is in front of the person if he is in the direction of the Qiblah, as researched by some of the scholars as a way of honouring it [the Qiblah]." [End of quote]
As regards the nasal mucus, its ruling is the same as the ruling of spitting; one should not blow his nose in the direction of the Qiblah, and the jurists have considered it to be the same as spitting. Ibn Muflih Al-Hanbali said in Al-Furoo’: “If a person has to spit, or to blow his nose, or cough up the phlem from his chest, then one may do so.... but it is disliked to do so in one’s front or on his right side, as Abu Hurayrah narrated that the Prophet said: “One should spit on his left or under his feet and then bury it (his expectoration)
Allaah Knows best.