vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   need help vbulletin/ seperate php script (https://vborg.vbsupport.ru/showthread.php?t=109697)

Vizionz 03-07-2006 08:16 AM

need help vbulletin/ seperate php script
 
Stand alone script trying to get stylesheet not working

will call this little code CODE 1
Quote:

<?
session_start();
require "common.php";
?>
that call will access a file that has this info in it


THIS IS CODE2 Also known as the common.php file
Quote:

<?php

function connectdbase() {
$db = mysql_connect("localhost", "username", "pass");
mysql_select_db("dataname",$db);
}

?>

This is where i have my problem.. if i put this in the php code with the CODE 1 snippet i end yup with Unable to add cookies, header already sent
So where would this problem becoming from. why would the two conflict

Quote:

<?
chdir('/home/Forum);
require_once('./global.php');
?><? echo $style['css']; ?>

Marco van Herwaarden 03-07-2006 08:27 AM

If you really need to set your own head/session/cookies, you could try adding one (or both) of the following lines before your call to global.php:
PHP Code:

define('NOHEADER'1);
define('NOCOOKIES'1); 


Vizionz 03-07-2006 09:05 AM

thanks marco that was what i needed

ConKien 03-07-2006 06:07 PM

Quote:

Originally Posted by MarcoH64
If you really need to set your own head/session/cookies, you could try adding one (or both) of the following lines before your call to global.php:
PHP Code:

define('NOHEADER'1);
define('NOCOOKIES'1); 


Hi MarcoH64, but if I want to use global.php for VB's cookie to integrate with another app, would the above code disable the vb cookie system?

Thanks for your help!

Vizionz 03-07-2006 09:55 PM

yeah that disables the vb system so you would want to kill the cookies from the other app instead...

Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource
on line 29

$sql="SELECT * from songlist WHERE ID=$songID"; line 27
$result=mysql_query($sql);line 28
$data=mysql_fetch_object($result);line 29

offhand is there something wrong with that line ? that you can see

ConKien 03-07-2006 10:02 PM

Thanks Vizionz for the reply!

If the 2 lines above disable the vb system, then why we need to include the global.php? Isn't that the whole purpose of integrate with vb cookies, keep track of the session n stuff?

Vizionz 03-07-2006 11:56 PM

you dont have to use the two lines he put out i have to because th script i am working on requires to connect to a different database and uses its own individual cookies if you just need to grab the vbulletin info just use everything but them two lines

Quote:

Originally Posted by Vizionz
yeah that disables the vb system so you would want to kill the cookies from the other app instead...


Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource
on line 29

$sql="SELECT * from songlist WHERE ID=$songID"; line 27
$result=mysql_query($sql);line 28
$data=mysql_fetch_object($result);line 29

offhand is there something wrong with that line ? that you can see

anyone ?

Marco van Herwaarden 03-08-2006 07:01 AM

Do you have a valid DB connection?

Vizionz 03-08-2006 09:33 AM

i believe so its calling the database connection with the common.php file i posted above

<?
require "common.php";
echo "<body background='$background' bgcolor='$bgcolor' link='$links' alink='$links' vlink='$link'>";
connectdbase();
$sql="SELECT * from songlist WHERE ID=$songID";
$result=mysql_query($sql);
$data=mysql_fetch_object($result);
?>

thats what its doing at the beginning of the script so i dont understand

Vizionz 03-09-2006 09:44 AM

bump


All times are GMT. The time now is 06:35 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.02117 seconds
  • Memory Usage 1,745KB
  • 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
  • (2)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete