need some php/ajax help, if anyone has experience
I'm trying to figure out how to upload a value calculated from a .js file to a .php file. I need to send the value plus (I think) the session value for a user id. Afaik, I can only get the user id from the php file running the javascript. I don't seem to be able to make the ajax request from the php page running the javascript, instead needing to run it from the .js file that calculates the value.
I saw something like:
Code:
$.ajax(
url: "upload.php",
type: "POST",
data: { 'u': <?php echo $userid; ?>, 'v': value}
);
but it won't run properly from php, and the .js file doesn't like the syntax and obviously can't parse the <?php ?> statement.
What's a boy to do? I'm sadly very inexperienced with ajax calls. =-/
Edit
Can I just pull the user id from the session variable?
Last edited by Loki; 03-20-2017 at 11:03 PM.