The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Javascript Applet & Getting UserID In Serverside PHP Script
I've got a Javascript applet which calls a PHP file for some serverside interaction (I suppose that makes it some form of AJAX). The problem is that while my PHP script calls the necessary vBulletin global.php (and just in case, includes/user_functions.php) the variable $vbulletin->userinfo[userid] is always 0.
When executing the serverside PHP script in the browser, the variable is properly set to the userID number. Naturally, I suspect that this has to do with the fact that the applet is calling the PHP script instead of the browser. However, I don't have the source code to the applet so I can't modify it to pass along any other extra variables. I had a brief fever dream about checking the IP address and comparing it with what I've got in the database to determine which user it is, but then I came to the realization that if I've got two users in the same location (maybe a library or a school network) they would turn up at the same IP address. So I ended up back at square 1. Anyone got any ideas about how I can go about getting the userID? |
#2
|
||||
|
||||
How are you calling the PHP script? (i.e. post some code)
|
#3
|
||||
|
||||
I can't post the code, it's a 3rd party product which I don't have the redistribution rights for.
I solved the issue though, I was able to append arguments to the end of the PHP file in the javascript call. The tricky part was getting the PHP variables to the Javascript that in an embedded JS file instead of directly in the outputted page code. I ended up just having to create a javascript variable in the page code which the JS file would then make use of. It's all a bit tricky, but the issue I had was resolved. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|