Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implements whatsapp share button in website [duplicate]

Im building a website in php , i would like to implement whatsapp share button in it .I searched the internet for a while but couldn't find anything can any one explain how it works and how can i implement

Thanks in advance

like image 593
Faizal Hussain Avatar asked Jun 06 '18 05:06

Faizal Hussain


2 Answers

This might help you

<a href="https://api.whatsapp.com/send?phone=91XXXXXXXXXX&text=urlencodedtext" target="_blank">WA</a>

phone and text parameters are not mandatory

this works in the mobile browser and pc browser, in pc this will open https://web.whatsapp.com/

I think this might be a better solution.

like image 177
Dhanu K Avatar answered Oct 21 '22 00:10

Dhanu K


Please note that this only works with mobile devices and mobile browsers

use this to share in whatsapp, text= The text to share / link / or anything; if you are using url, dont forget to encode it

<a href="whatsapp://send?text=The text to share!" data-action="share/whatsapp/share">Share via Whatsapp</a>
like image 13
Akhil Aravind Avatar answered Oct 20 '22 22:10

Akhil Aravind