There is a guest book. Textarea and button. On php did, it works. But I wanted to add ajax so that the page does not reload.
How can I tell javascript'u user id?
I'll get better. How to do the same, if the javascript itself in the included file?
There is a guest book. Textarea and button. On php did, it works. But I wanted to add ajax so that the page does not reload.
How can I tell javascript'u user id?
I'll get better. How to do the same, if the javascript itself in the included file?
Make the request so, and in php already understand the session, what id the user has.
one.
Ajax: <?php echo $userId; ?>
2
Ahah: <?php echo "var userid = ".$userId; ?>
The easiest way. JSON, XML and others are already harder =)
Source: https://ru.stackoverflow.com/questions/66447/
All Articles