Deo koda koji je to obavljao bez greške je ovaj:
<?php
$RecIZG1=”rastuaka ie luok unđe apa kurgatuariie sa-nparće în doă”; //primer vlaške fraze
?>
<div id="player1"></div>
<form method="post">
<input type="button" class="dajizgovor" name="submit" value=" Klik za izgovor fraze 1" onclick="getAudio()"/>
</form>
<script>
function getAudio(){
var txt=jQuery('#txt').val()
jQuery.ajax({
url:'izgovor1.php',
type:'post',
data:'txt=<?php echo $RecIZG1; ?>',
success:function(result){
jQuery('#player1').html(result);
}
});
}
</script>
Funkcija ”izgovor” izgleala je ovako:
izgovor1.php
<?php
if(isset($_POST['txt'])){
$txt1=$_POST['txt'];
$txt1=htmlspecialchars($txt1);
$txt1=rawurlencode($txt1);
$html=file_get_contents('https://translate.google.com/t...ie=UTF-8&client=gtx&q='.$txt1.'&tl=sr-SR'); //linija 6
$player1="<audio class='plejer-fraze' autoplay><source src='data:audio/mpeg;base64,".base64_encode($html)."'></audio>";
echo $player1;
}
?>
Poruka greške:
Warning: file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /homeslow/paund/public_html/vlaski.recnik/izgovor1.php on line 6
Warning: file_get_contents(https://translate.google.com/t...ie=UTF-8&client=gtx&q=”rastuaka ie luok unđe apa kurgatuariie sa-nparće în doă”&tl=sr-SR): failed to open stream: no suitable wrapper could be found in /homeslow/paund/public_html/vlaski.recnik/izgovor1.php on line 6
Napomena:
Preko cPanela dodao sam u php.ini liniju:
allow_url_fopen=1
ali se ništa nije promenilo
Izvorna php stranica je ova>
https://www.paundurlic.com/vla...c-frazesve-izgovor.php?id=6348
Bio sam strašno ponosan na ovaj deo svoje aplikacije, pa ne znam kako bih peživeo kad bih morao da je osakatim ...
[Ovu poruku je menjao pakito dana 17.02.2024. u 15:11 GMT+1]