javascript - Php variable from php file to php file using jquery -


i have small problem. need send php variable php file second php file using setinterval. dont know how can write php variable in jquery code.

first.php

<?php  $phpvariable=1; ?> 

in javascript

setinterval(function odswiez(id) {  $('#chat').load('second.php?id=<here php variable how?>'); }, 3000); }); 

second.php

<?php $w=$_get['id']; echo $w; ?> 

you need echo value

$('#chat').load('second.php?id=<?php echo $variable ?>'); }, 3000); 

alternative be..

$('#chat').load('second.php?id=<?php echo "id-{$variable}" ?>');     }, 3000); 

Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -