![]() |
Can't get plugin code to work
Hey everyone, I need some help on a short bit of code I want to put in a plugin. The code looks like this:
PHP Code:
PHP Code:
Any help would be greatly appreciated! Thanks! - Pianoman993 |
You should use $vbulletin->userinfo instead of $bbuserinfo now :)
Try: PHP Code:
|
What are you trying to do there? Why do you need to use putenv()?
|
I'm trying to get variables into a CGI script via putenv().
However, I may try to just use $_ENV Thanks for all the help! --------------- Added [DATE]1230357708[/DATE] at [TIME]1230357708[/TIME] --------------- Alright. Hold the phone. Alright, so I've got this CGI script and I've got 2 variables in there. One wants a session ID The other wants the Username So I'm trying to communicate with this CGI Script through vbullitan's plugin system and it's killing me to no end. I can't take it! I can't for the life of me figure it out!! HOW DO YOU PASS PHP VARIABLES INTO CGI SCRIPTS!!!! AHHH!!! *heavy breathing, high blood pressure* I know it is most likely a newby question. But if ANYONE! out there can help me out I would SOOOOOOOOOOOOO greatly appreciate their GODLY help. "Help me Obi-Wan-Kenobi, your my only hope" - Pianoman993 |
Can't you add another item on your query string?
|
That could easily be hacked. I was originally trying to deala with session variable since they were the most secure.
|
Please note that putenv() might not function as expected in Safe Mode for example.
Is the included script on the same server? If yes, then why do you include it with an URL instead of a local path. If oncluded locally it can inherit environment, and even variables defined in the local scope of the calling script. If on another server, then you can never pass environment variables, as each server will have it's own environment. The only way to pass parameters is in the request string. |
Thanks so far for all your useful information.
Marco, would it be possible for you to show me a code example of how to pass information such as the username ($vbulletin->userinfo['username']) into a secure string that I could pass into a CGI script? And also, where would I do that, in the global.php file, a plugin? Much thanks! - Pianoman993 Also, just to give you some frame of reference so you know where I'm coming from, this is part of the CGI script. Code:
Code:
|
Why not start by answering the question i posted in my previous post.
No answer = no good answer from me. |
:( Sorry. My fault. The included script IS on the server. There you are. I have to use the full filename to include it or else it does not work.
In essence, I am trying to integrate with vbulletin's login. |
If the script is local, then you should also include it clocally:
Do not: PHP Code:
PHP Code:
|
Thanks for your post.
So your saying that this: (below) is unnecessary? Would I create a simple variable in the page that calls the CGI script, or would I do it in the vbulletin plugin? Also, what would the CGI variable look like? Would it look like $ENV{username}; ? Code:
# putenv("PHP_ENC_USERNAME=$username"); # where $username is your PHP user variable. - Pianoman993 |
You would call it from a plugin, you can not execute PHP code in a template (HTML).
There is no "CGI variable". They are just simple PHP variables as used anywhere in a PHP-script. Consider the following 2 scripts: Main script "test.php" PHP Code:
PHP Code:
You will see that the variable $mainvar that was set in "test.php" is also available in "sub.php" without any variable passing or such. The same goes for $subvar, set in sub.php and still available when returning in test.php. |
Alright so here is my new plugin code:
PHP Code:
Code:
# PREFs Section 03: Security. |
Quote:
|
Gotcha, that'll work. Thanks!
|
All times are GMT. The time now is 03:12 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|