1

I want to make php script that replace the execution of this kind of a link:

<a href="ymsgr:sendim?tonystark">YM! Iron Man</a>

So when the php script is called/executed, it will open Yahoo Messenger application window that prepared to send IM to tonystark.

Can I use header instead? but what type of header it would be?

M.Pribadi
  • 67
  • 1
  • 6
  • 2
    That doesn't connect to a web server, it starts the Yahoo! Messenger application. It's similar to the way `mailto:` opens your mail client. – Barmar May 16 '13 at 11:11
  • I suggest you google the topic a bit further. The question is a bit unclear and are therefore not really possible to help. It should be more clear what exactly the problem is. I also suggest another title fx: "How to open a Yahoo Messager application window?". – CodeTower May 16 '13 at 11:32

2 Answers2

2

The ymsgr is a custom protocol that is configured to start Yahoo Messenger, which is able to parse appropriate parameters following the ":".

This question (how do I create my own URL protocol?) may be relevant as it shows how it is possible to add custom URL protocols. The example is for Windows only but it must be a similar approach for other operating systems.

To make a story short, ymsgr: opens Yahoo Messenger because your system can recognize it and that Yahoo Messenger is its associated action.

Community
  • 1
  • 1
Frederik.L
  • 5,522
  • 2
  • 29
  • 41
0

The ymsgr in the link is a predefined protocol on your PC. Just like http, https and ftp are protocols known to your system. If you want to create custom protocols to be handled by the pc of your visitor, you must have them install something that will add the protocol to the system. Only then will the pc know what to start.

A good example of a non-standard installed protocol is skype. The links to add a user to your skype or chat with them only works if the visiting person has Skype installed. Otherwise an error occurs on the computer; "I don't know this protocol, what to do?"

So using a header to replicate the link will not work. Simply because your PC will not understand a header; it will only understand links to protocols, as if you are opening a page (http,https), email application (mailto), ftp programme (filezilla, unless handled by browser) etc etc.

Luceos
  • 6,629
  • 1
  • 35
  • 65
  • This is the idea what makes the question: if clicked link like `http://stackoverflow.com` can be replaced by `header('Location:http://stackoverflow.com')`. How can I do the same about `ymsgr:sendim?someuser` using php header script. So the answer may lay in `header` documentation somewhere, that's what came up in my logic in the 1st place. But if its more client side orientation, can a client side script, say javascript, replicate the ymsgr: ? – M.Pribadi May 17 '13 at 06:54