@רק-טוב היה לך כמה בעיות בקוד אנה הקוד המתוקן```
<?php
// קבלת נתונים מ-GET
$did = $_GET['did'] ?? null;
$pass = $_GET['pass'] ?? null;
$path = $_GET['path'] ?? null;
$text = $_GET['text'] ?? '';
$did1 = $_GET['did1'] ?? '';
$did2 = $_GET['did2'] ?? '';
$did3 = $_GET['did3'] ?? '';
$did4 = $_GET['did4'] ?? '';
$did5 = $_GET['did5'] ?? '';
$did6 = $_GET['did6'] ?? '';
$did7 = $_GET['did7'] ?? '';
$did8 = $_GET['did8'] ?? '';
$did9 = $_GET['did9'] ?? '';
// בדיקה שהמשתמש סיפק את כל הנתונים הנדרשים
if ($did == null) {
echo "read=m-2571=did,yes,10,9,15,Digits,yes,,,,,,,";
exit();
}
if ($pass == null) {
echo "read=m-1800=pass,yes,100,1,24,Digits,,,,,,,";
exit();
}
if ($path == null) {
echo "read=t-אנא הקישו את מספר השלוחה וסולמית בסיום לשלוחה ראשית הקישו כוכבית וסולמית לשלוחה כוכבית הקישו פעמים כוכבית ואז 1 וסולמית לשלוחה סולמית הקישוא פעמים כוכבית ואז 2 וסולמית=path,no,10000,0,14,Alpha,no,no,*/,,,ok,,";
exit();
}
// פונקציה להחלפת תווים מיוחדים בטקסט
function unicodeToUtf8Hebrew($text, $replacements) {
$output = '';
if (strpos($text, "u0") !== false) {
$exploded = explode(" ", trim($text));
foreach ($exploded as $item) {
$chars = str_split($item, 5);
foreach ($chars as $char) {
$upper = strtoupper($char);
$output .= $replacements[$upper] ?? $upper;
}
$output .= ' ';
}
} else {
$output = $text;
}
return trim($output);
}
// מערך תחליפים
$repl = [
'?' => '=',
'!' => '/',
'+-' => '%23',
'%2A' => '+@',
'%26' => ' ',
'_' => ' ',
'.--' => '%25',
'?1' => $did1,
'?2' => $did2,
'?3' => $did3,
'?4' => $did4,
'?5' => $did5,
'?6' => $did6,
'?7' => $did7,
'?8' => $did8,
'?9' => $did9,
'?pass' => $pass,
'?did' => $did,
'?path' => $path
];
// החלפת טקסט לפי מילון התחליפים
$text1 = unicodeToUtf8Hebrew($text, $repl);
// שליחת הבקשה ל-API
$url = "https://www.call2all.co.il/ym/api/UpdateExtension?token={$did}:{$pass}&path1=ivr2:{$path}&{$text1}";
$response = file_get_contents($url);
$data = json_decode($response, true);
// בדיקת תגובת API
if ($data['responseStatus'] === 'OK') {
echo "id_list_message=t-הפעולה בוצעה בהצלחה,,,";
} else {
echo "id_list_message=m-1801.1080. &go_to_folder=hangup";
}
exit();
?>