$(document).ready(function(){
$("#hide").click(function(){
$("p").hide();
});
$("#show").click(function(){
$("p").show();
});
});
welcome
welcome
<script>
$(document).ready(function(){
$('#form-id').on('submit',function(e){
e.presentDefault();
$ajax({
type: "POST",
url: "form/store",
data: $('#form-id').serialized();
success: function(response)
{
console.log(response)
alert("data is stored");
},
error: function(error){
console.log(error)
alert("data is not saved");
}
});
});
});
</script>
public static function WhtasappNotifications($number,$message)
{
$numbers = $number;
foreach ($numbers as $key => $number) {
$data = [
'phone' => $number, // Receivers phone
'message' => $message, // Message
];
$json = json_encode($data); // Encode data to JSON
$token = 'Add your token'; //for exp: 6fe7edcadf066690e8090
$instanceId = 'Add instance id'; //for exp: 331E661FFC
$url = 'https://app.wappapi.in/api/send.php?number='.$number.'&type=text&message='.str_replace(' ', '%20',$data['message']).'&instance_id='.$instanceId.'&access_token='.$token;
$options = stream_context_create(['http' => [
'method' => 'POST',
'header' => 'Content-type: application/json',
'content' => $json
]
]);
// Send a request
$result = file_get_contents($url, false, $options);
}
return true;
}