Ip camera からビデオを録画するプロジェクトを行っています。私はajaxを使用して、process.phpファイルのコードを使用してビデオを正常に記録するプログラムバックエンドを実行しました。しかし、私は各ユーザーに対してプログラムをより動的にしようとしており、次のページにパラメーターを渡す際に問題に直面しています。 ajaxリンクを使用したphp:
xmlhttp.open('GET','http://localhost/IPCAM/process.php?sh=1&url=<?php echo $url ?>&email=<?php echo $email ?>',true);
これが完全なスクリプトです。動的に動作するように上記の URL を記述する適切な方法を誰かに提案してもらえますか。
<script type="text/javascript">
function st()
{
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else
{
xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
alert('stored');
}
}
xmlhttp.open('GET','http://localhost/IPCAM/process.php?sh=1&url=<?php echo $url ?>&email=<?php echo $email ?>',true);
xmlhttp.send();
setTimeout('st()',5000);
}
</script>