vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Help with a hack (https://vborg.vbsupport.ru/showthread.php?t=33800)

pgowder 01-04-2002 07:49 PM

I'm creating an addition to my vbulletin.

I'm getting this error:

Quote:

Warning: Cannot add header information - headers already sent by (output started at /home/sites/home/web/gathering/pw_event_whois.php:3) in /home/sites/home/web/gathering/admin/functions.php on line 1490
Here is the code:

PHP Code:

<?
require('global.php');

if ($bbuserinfo[userid]==0) {

//Send user to the registration page
show_nopermission();
} else {

//Enter the username into pw_whois


mysql_query("insert into pw_whois (eventid, username, userid) values ('7', '$bbuserinfo[username]', '$bbuserinfo[userid]')");


//Send the user back to the calendar


echo ("<html><body onload=document.location.href='http://www.powwows.com/gathering/pw_calendar/pw_event_display.php?eventid=7'></body></html>");

}
?>

Thanks

amykhar 01-04-2002 07:53 PM

Two things to check:

a) make sure there are no blanks after the closing > at the end of the file.

b) set your cookie domain in your control panel. I have no idea why this has an effect, but it has worked for others.

Amy

pgowder 01-04-2002 08:00 PM

How do I set the cookie domain?? What should it be set to??

Simon Moon 01-05-2002 11:37 PM

Little hint, use the stuff from vB to access the DB. Makes your life easier :)

pgowder 01-06-2002 01:39 AM

I'm using global??? What else can I use??

Simon Moon 01-06-2002 02:04 AM

Well, there are 2 things specially i dont like in that thing :)

PHP Code:

mysql_query("insert into pw_whois (eventid, username, userid) values ('7', '$bbuserinfo[username]', '$bbuserinfo[userid]')");

//Send the user back to the calendar

echo ("<html><body onload=document.location.href='http://www.powwows.com/gathering/pw_calendar/pw_event_display.php?eventid=7'></body></html>"); 

You can make thse 2 nicer if you FIRST use the database class of the board and SECOND if you redirect by header (wich is smother).

Would look like this for your example:
PHP Code:

$DB_site->query("insert into pw_whois (eventid, username, userid) values ('7', '$bbuserinfo[username]', '$bbuserinfo[userid]')");

//Send the user back to the calendar

header ("Location: [url]http://www.powwows.com/gathering/pw_calendar/pw_event_display.php?eventid=7[/url]"); 

But i would not do a full url in these scripts, make it more variable, this saves you headaches. Feel free to copy paste this.
The reason to use the class is, that you use the data from the class AND use the same error reporting tools. If something happens, you get informed...

pgowder 01-06-2002 03:38 AM

I tried to use the headers, but I got errors about headers already being set. I'll change the other part.

Thanks

pgowder 01-22-2002 03:26 PM

I'm still having problems with the cannot set headers error:

Warning: Cannot add header information - headers already sent by (output started at /home/sites/home/web/gathering/pw_event_whois.php:3) in /home/sites/home/web/gathering/admin/functions.php on line 1490

Any ideas??

pgowder 01-29-2002 01:52 PM

Can someone help??

Why do I get this header error?


All times are GMT. The time now is 01:46 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01046 seconds
  • Memory Usage 1,731KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete