PDA

View Full Version : Cookie for the forums, cookie for non-vB pages, but work together


Curll
05-03-2004, 03:28 AM
<a href="http://www.xblgamers.com/indexnew.php" target="_blank">http://www.xblgamers.com/indexnew.php</a>

See, the "Community" section calls on global.php and if you're not logged into the forums (user: Pretty Lush pass: qwerty if you wanna see the working version of that page) gives you the

Unable to add cookies, header already sent.
File: /home/xblgamer/public_html/indexnew.php
Line: 1

So, my thinking is to set a seperate cookie for the forums and a cookie for the main page. The cookie from the main page can be used to get vB info for the community section.

Anyway I can do this? Or is it the wrong solution or what?

EDIT:

Line 1 of the indexnew.php is:
<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?>

and if I remove that, it goes down to line 14 or so, which is <style type="text/css"> .

So, it's all odd.

NTLDR
05-03-2004, 10:36 AM
Your probably echoing stuff out before you have sent the cookies and all the headers, thus you get the error. Take a look at vB's phpinclude template for howto use output buffering an use that on your page.

Curll
05-03-2004, 03:28 PM
I'm a pretty large newbie here, so bare with me.

1) What should my "header.html" be? I have a header.php file for all of my non-vB pages, and I assume that's what it means, but I just want to be sure.
2) The ob get contents....what content should that get?

Anything else I should know? Is there a tutorial or FAQ or something related to this?

Curll
05-05-2004, 02:41 AM
Help, please :)