The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
vBulletin and PHP cookies
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 ShellFnsefaultAction. 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 ShellFnsefaultAction, 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"); ShellFnsefaultAction(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>"); --------------- Added [DATE]1223047091[/DATE] at [TIME]1223047091[/TIME] --------------- As a side note, the display of this post is putting a smiley for all occurances of : (colon colon D), even though I specified no smileys, no icons and left the additional options as defaults. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|