v2.5.2
Giriş yap

Netgsm sms entegrasyonu hata

emmir
669 defa görüntülendi

Kodları ben yazmadım ama netgsm entegrasyonu lazım oldu hata alıyorum hata şu

Bilgilerim Bilgilerim Bilgilerim 1:n Bilgilerim
{$tel} "; ?>
Fatal error: Uncaught Error: Call to undefined function XMLPOST() in C:\xampp\htdocs\sms.php:9 Stack trace: #0 {main} thrown in C:\xampp\htdocs\sms.php on line 9

<?php
    <!DOCTYPE html>
<html>
<head>
	<title>Sms Gönderim NetGSM API</title>
	<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
</head>
<body>

<div class="container">
	<div class="row">
		<div class="col-md-12"><h1>Sms Gönderim</h1></div>
		<form action="sms.php" method="post">
		<label>Telefon No</label>
		<input type="number" class="form-control" name="tel" placeholder="örn.0542 291 85 75" required="">
		<label>Mesajınız</label>
		<textarea class="form-control" name="mesaj" placeholder="mesajiniz" required=""></textarea>
		<button type="submit" class="btn btn-success">Gönder</button>
		</form>
	</div>
</div>

</body>
</html>



<-- sms.php -->


<meta http-equiv="refresh" content="1;URL=index.php">
<?php

$mesaj= $_POST["mesaj"];
   $tel= $_POST["tel"];

	include 'smsgonderim.php';
	
$gelen=XMLPOST('http://api.netgsm.com.tr/xmlbulkhttppost.asp',$xml);

echo '<script type="text/javascript">alert("mesajınız gönderilmiştir.");</script>';
?>





<-- sms.php -->
    
    
    
    
    
    
    
    <-- smsgonderim.php -->
        
        <?  
function XMLPOST($PostAddress,$xmlData)
{
		$ch = curl_init();
		curl_setopt($ch, CURLOPT_URL,$PostAddress);
		curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,1);
		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
		curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml"));
		curl_setopt($ch, CURLOPT_TIMEOUT, 30);
		curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlData);
		$result = curl_exec($ch);
		return $result;
}
$username   = 'bilgilerim';
$password   = 'bilgilerim'; 
$orgin_name = 'bilgilerim'; 

$xml="<mainbody>
	<header>
		<company>bilgilerim</company>        
        <usercode>bilgilerim</usercode>
        <password>bilgilerim</password>
        <type>1:n</type>
        <msgheader>bilgilerim</msgheader>
        </header>
		<body>
		<msg><![CDATA[{$mesaj}]]></msg>
		<no>{$tel}</no>
		</body>
</mainbody>";
?>
        
    <-- smsgonderim.php -->
    
    
    
    
    
    
?>
Cevap yaz
Cevaplar (2)
fuatogur
1086 gün önce

öncelikle bu kodu

<meta http-equiv="refresh" content="1;URL=index.php">

aşağıdaki gibi değiştir

header("Refresh:2;url=index.php");

onun dışında da bir problem göremedim fonksiyon tanımlanmadı hatası alıyorsun smsgonderim.php nin sayfan dahil edildiğinden emin ol.

emmir
1085 gün önce

Evet hocam hiçbir sorun yokmuş localde olduğu için göndermiyormuş sunucumda denedim başarılı şekilde çalışıyor ilgin iiçin teşekkürler