Jump to content

Implenting codon.config.php in a standalone php page


Recommended Posts

For on of my pages that are separate from phpVMS I want to use data from phpVMS and put it into a table. I have put in this code in the <head> part:

<?php
require_once("VatsimPHPgenerator.php");
$VatsimPHP=new VatsimPHP;
include 'core/codon.config.php';
?> 

And I get this error:

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at F:\XAMPP\xampp\htdocs\deparr.php:14) in F:\XAMPP\xampp\htdocs\core\codon.config.php on line 40

Anyone know whats wrong?

Link to post
Share on other sites
  • Administrators

There are a couple of threads on inplementing the phpvms classes outside of the core install, but your "cannot send headers" error is usually an issue of having white space, sometimes not noticeable, right before or right after a opening or closing php tag.

This thread may help some -> http://forum.phpvms.net/topic/3394-external-pilot-centre/page__p__23466__hl__%22include%22__fromsearch__1#entry23466

From php.net

PHP Error: Cannot modify header information

This is a common PHP error which is usually caused by:

- White spaces before or after the PHP start "<?php" or end "?>" tags;

- Various problems with the header() statement. Check carefully the code before and at the line of this statement.

This error might be hard to troubleshoot in cases where different files are included and all of them have to be carefully expected. An easy workaround is to place a php.ini file containing the following directive:

output_buffering = On

This php.ini file has to be placed in the directory where the error occurs.

IMO, it is much easier to include outside scripts and classes within phpvms then the other way around if phpvms is your base application.

The vatsim generator script has been implemented within phpvms in the past with success, although I have found that there has to be a few modifications to it if your server is running php 5.3.x, unless the script has been updated recently.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...