![]() |
vBulletin and PHP Cookies
I had hoped to ask this in the Programming Forum, but since I don't have access to that, I thought I'd ask it here. Please redirect as required.
I am trying to use vBulletin in such a way that if it is not started from my Windows-based C++ application, then vBulletin will not start up. This is achieved with the C++ code, listed below. The SendRequest call creates a POST header to be passed to start.php, listed below. I know this works because $_POST["App"] exists and the script pauses for 5 seconds because supposedly the cookie in the script was created due to the if check on $post. After the 5 second delay, the message box in the C++ code displays, so I know it's not immediately trying to execute index.php with the C++ call to ShellFns::DefaultAction. If $post from start.php is null (such as by launching http://www.zokero.com/vBulletin/start.php directly in IE7), I execute the exit("start: ..."), which alsp works as expected. In index.php provide by the install of vBulletin, I added the 3 lines into that file, as listed below. The problem I'm running into is that even though start.php creates the cookie because $post from the script is not null as called from C++ SendRequest, when I get to index.php from the C++ function ShellFns::DefaultAction, index.php thinks the $_COOKIE["App"] DOES NOT exist and the exit("index:...") is displayed EVERY TIME!! I can not get past this, no matter what I try, so I'm hoping that you will be able to provide with a solution and/or tell me why my approach soesn't work. Thank you for your time and attention regarding this matter. C++: SendRequest("http://www.zokero.com/vBulletin/start.php", CString("App=SeisWare"), sHeaderReceive, sMessage); MessageBox("Test"); ShellFns::DefaultAction(m_hWnd, "http://www.zokero.com/vBulletin/index.php"); start.php: <?php $post = $_POST["App"]; if ($post != null) { $duration = time() + 8 * 60 * 60; $success = setcookie("App", "SeisWare", $duration); if ($success == TRUE) sleep(5); } else exit("<html><body><center><h1>start: Please restart SeisWare to access the forums.</h1></center></body></html>"); ?> index.php: $app = $_COOKIE["App"]; if ($app == null) exit("<html><body><center><h1>index: Please restart SeisWare to access the forums.</h1></center></body></html>"); |
dvongrad,
You are currently showing up as unlicensed. To be able to download modifications and/or receive support here at vBulletin.org, we ask you to please click here (vB-Germany users click here, vB-Chinese users click here) and enter your email address. You will need to use your customer number and password (which will be in the email you got when you paid for your license) to access that page. Please note that your email is case sensitive. To protect our customers privacy you will also need to Opt-In to license validation for all Support Sites. You must authorise vBulletin.org in order to validate your license status here. You can do this at the page linked above for your distributor. Make sure to set the permission to allow vBulletin.org to validate your status. The update of your account can take up to one hour. Thank you. |
All times are GMT. The time now is 06:22 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:
|