$("#profile_bar").mouseover(function(){
<?php $_SESSION['sessionasdf'] = 'asdf'; ?>
});
Hello! I have been busy with this for an hour, but I'm deadbrain now. Can someone help me out or give me a hint? Is the function I wrote above, even possible?
Thanks in advance!
You need an Ajax Request to do this. You can't simply start a session in a script that's already been loaded.
$("#profile_bar").mouseover(function() {
$.ajax({
url: "sessionStartPage.php",
cache: false,
success: function(data) {
alert("session has begun. Refreshing page now");
location.reload(); //reload the page to load session variables
}
});
});
As I said you have to use a technique called AJAX.. So its time to start learning:) http://www.smashingmagazine.com/2008/10/16/50-excellent-ajax-tutorials/
PHP run on server, JQuery(the javascript) run on browser.That's different. And you can start the session at every page on server, rather than by the event on browser.