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

python - jinja2: TemplateSyntaxError: expected token ',', got 'string' -

Qt4: how to send QString inside a struct via QSharedMemory -

node.js - NodeJS remote terminal to Dropbear OpenWRT-Server -