<div class="grid--cell fl1 lh-lg">
<div class="grid--cell fl1 lh-lg">
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, <a href="/help/reopen-questions">visit the help center</a>.
</div>
</div>
</div>
<div class="grid--cell mb0 mt8">Closed <span title="2013-06-11 23:10:03Z" class="relativetime">6 years ago</span>.</div>
</div>
</aside>
I am trying to call this php script through a JQuery ajax function. It just returns status 0 error? I might be the url or something, but im not quite sure. Any suggestions?
php:
<?php
require_once('classes/DbH.php');
$dbh = new Dbh('signatur_stories');
$dbh->query("set names utf8;");
$videoUrl = $_GET['videourl'];
echo 'jeg er et php script!!';
if(isset($videoUrl) && !empty($videoUrl)){
$sql = sprintf('UPDATE podcast SET isValidated=1 WHERE url="%s"', $videoUrl);
$dbh->query($sql);
}
?>
JS:
function validateVideo(){
alert(player.currentSrc.substring(57));
$.ajax({ url: '/../inc/validatePodcast.php',
type: 'get',
data: 'videourl=' + player.currentSrc.substring(57),
success: function() {
alert("hej");
window.location.href="../staff/admin.php";
},
error: function(jqXHR, exception) {
if (jqXHR.status === 0) {
alert('Not connect.
Verify Network.');
} else if (jqXHR.status == 404) {
alert('Requested page not found. [404]');
} else if (jqXHR.status == 500) {
alert('Internal Server Error [500].');
} else if (exception === 'parsererror') {
alert('Requested JSON parse failed.');
} else if (exception === 'timeout') {
alert('Time out error.');
} else if (exception === 'abort') {
alert('Ajax request aborted.');
} else {
alert('Uncaught Error.
' + jqXHR.responseText);
}
}
});
}
</div>
url: '/../inc/validatePodcast.php'
Is that correct?