Clay_dropdead
Honorary Poster
- Joined
- Feb 28, 2017
- Posts
- 332
- Reaction
- 206
- Points
- 229
Hi sa mga php developers dyan magpapatulong po sana ako about this codes papano kaya makapag send ng dalawa o higit pang contacts sa code ko
<?php
//##########################################################################
// ITEXMO SEND SMS API - PHP - CURL-LESS METHOD
// Visit You do not have permission to view the full content of this post. Log in or register now. for more info about this API
//##########################################################################
function itexmo($number,$message,$apicode){
$url = 'You do not have permission to view the full content of this post. Log in or register now.
$itexmo = array('1' => $number, '2' => $message, '3' => $apicode);
$param = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($itexmo),
),
);
$context = stream_context_create($param);
return file_get_contents($url, false, $context);}
//##########################################################################
if($_POST){
$number = $_POST['number'];
$name = $_POST['name'];
$msg = $_POST['msg'];
$api = "TR-ACEHA784027_8U8LT";
$text = $name. "" .$msg;
echo $text;
if(!empty($_POST['name']) &&($_POST['number'])&& ($_POST['msg'])){
$result = itexmo($number,$text,$api);
}
if ($result == ""){
echo "iTexMo: No response from server!!!
Please check the METHOD used (CURL or CURL-LESS). If you are using CURL then try CURL-LESS and vice versa.
Please CONTACT US for help. ";
}else if ($result == 0){
echo "Message Sent!";
}
else{
echo "Error Num ". $result . " was encountered!";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>SMSModule</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="You do not have permission to view the full content of this post. Log in or register now."></script>
<script src="You do not have permission to view the full content of this post. Log in or register now."></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-4 col-sm-6 col-xs-12">
<form method="POST" action="index.php">
<div class="form-group">
<label for="name">Your Name</label>
<input type="text" maxlength="10" class="form-control" id="name" placeholder="Name" name="name" required>
</div>
<div class="form-group">
<label for="number">Recipient's Mobile Number </label>
<input type="text" class="form-control" id="number" placeholder="Mobile Number" name="number" required>
</div>
<div class="form-group">
<label for="msg">Your Message</label>
<textarea class="form-control" rows="3" name="msg" placeholder="Message Here" onkeyup="countChar(this)" required></textarea>
</div>
<p class="text-right" id="charNum">85</p>
<button type="submit" class="btn btn-success">Send</button>
</form>
</div>
</div>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="You do not have permission to view the full content of this post. Log in or register now."></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
<script>
function countChar(val){
var len = val.value.length;
if(len >=85){
val.value = val.value.substring(0,85);
}else{
$('#charNum').text(85-len);
};
}
</script>
</body>
</html>
<?php
//##########################################################################
// ITEXMO SEND SMS API - PHP - CURL-LESS METHOD
// Visit You do not have permission to view the full content of this post. Log in or register now. for more info about this API
//##########################################################################
function itexmo($number,$message,$apicode){
$url = 'You do not have permission to view the full content of this post. Log in or register now.
$itexmo = array('1' => $number, '2' => $message, '3' => $apicode);
$param = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($itexmo),
),
);
$context = stream_context_create($param);
return file_get_contents($url, false, $context);}
//##########################################################################
if($_POST){
$number = $_POST['number'];
$name = $_POST['name'];
$msg = $_POST['msg'];
$api = "TR-ACEHA784027_8U8LT";
$text = $name. "" .$msg;
echo $text;
if(!empty($_POST['name']) &&($_POST['number'])&& ($_POST['msg'])){
$result = itexmo($number,$text,$api);
}
if ($result == ""){
echo "iTexMo: No response from server!!!
Please check the METHOD used (CURL or CURL-LESS). If you are using CURL then try CURL-LESS and vice versa.
Please CONTACT US for help. ";
}else if ($result == 0){
echo "Message Sent!";
}
else{
echo "Error Num ". $result . " was encountered!";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>SMSModule</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="You do not have permission to view the full content of this post. Log in or register now."></script>
<script src="You do not have permission to view the full content of this post. Log in or register now."></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-4 col-sm-6 col-xs-12">
<form method="POST" action="index.php">
<div class="form-group">
<label for="name">Your Name</label>
<input type="text" maxlength="10" class="form-control" id="name" placeholder="Name" name="name" required>
</div>
<div class="form-group">
<label for="number">Recipient's Mobile Number </label>
<input type="text" class="form-control" id="number" placeholder="Mobile Number" name="number" required>
</div>
<div class="form-group">
<label for="msg">Your Message</label>
<textarea class="form-control" rows="3" name="msg" placeholder="Message Here" onkeyup="countChar(this)" required></textarea>
</div>
<p class="text-right" id="charNum">85</p>
<button type="submit" class="btn btn-success">Send</button>
</form>
</div>
</div>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="You do not have permission to view the full content of this post. Log in or register now."></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
<script>
function countChar(val){
var len = val.value.length;
if(len >=85){
val.value = val.value.substring(0,85);
}else{
$('#charNum').text(85-len);
};
}
</script>
</body>
</html>