I know you can't directly use PHP variables inside javascript code, but is there a way around it? I need to use these parameter's in javascript:
username: '<?php echo $user_id;?>.example.co.uk',
password: 'example',
Instead of showing the $user_id variable, it outputs: "Resource id #4.example.co.uk"
I'm quite new to javascript so I'm finding it pretty tricky.
Thanks for any help
Edit: I am taking the $user_id variable from the URL like so:
$user_id = mysql_real_escape_string($_GET["user_id"]);
so shouldn't it just have the set value from the URL?