Topic: PunBB Interferring With Other PHP Programs

Hey everyone, I have a pretty serious problem. Right now I use PunBB as the forums (of course), news, and user system on my site. I use my own scripts for everything else (content management, etc). The problem is, whenever I declare the required PunBB variables in my page:

<?php
define('PUN_TURN_OFF_MAINT', 1);
define('PUN_QUIET_VISIT', 1);
define('PUN_ROOT', './forums/');
require PUN_ROOT.'include/common.php';
?>

I get Undefined Index errors in my other scripts. It never tells me that it has anything to do with PunBB, but I know for a fact that it does because when I take out this code it works perfectly, like it always has before I started using PunBB. The errors look like this:

Notice: Undefined index: media_download in /xxx/xxx/public_html/media.php on line 4

Line for of media.php is this:

$download_id = $_GET['media_download']

It's always something like this, a variable being defined (like $var1 = $_GET['something']) on every page. How can I fix this?

Re: PunBB Interferring With Other PHP Programs

well its not excatly PunBB's fault, PunBB turns on a higher level of error messages, you can turn it off by commenting out the error_reporting(E_ALL) line in common.php or you could fix all the problems with your pages, you can't use "$download_id = $_GET['media_download']" unless $_GET['media_download'] has a value

Re: PunBB Interferring With Other PHP Programs

Well, commenting out that line certainly helped, but it still gives me the same errors. The only difference now is that the PunBB functions work.

Re: PunBB Interferring With Other PHP Programs

And the value is defined by the MySQL table, I'm not very good at PHP or MySQL, and I didn't make the Content Management System I use, but by looking at the code thats how it's working. the $download_id is just a definition I think.

Re: PunBB Interferring With Other PHP Programs

try replacing the line with

$download_id = (isset($_GET['media_download'])) ? $_GET['media_download'] : '';

Re: PunBB Interferring With Other PHP Programs

Uh oh, now it's all pretty messed up with the exception of the media file. Here's the list of variables I need to replace:

$download_id = $_GET['download'];
$id = $_GET['id'];
$total_rw += $row['half1_rw']+$row['half2_rw'];
$total_rl += $row['half1_rl']+$row['half2_rl'];

And what about this code

  $query1 = "SELECT * FROM demos WHERE id='$download_id'";
  $result1 = mysql_query($query1) or die(mysql_error());
  $download = mysql_fetch_array($result1);
  $dl_url = $demo_path.$download['name'];
  $download_count = $download['dl_count'];
  $download_count = $download_count+1;
  $query2 = "UPDATE demos SET dl_count='$download_count' WHERE id='$download_id'";
  mysql_query($query2) or die(mysql_error());

Does that look OK? And in the rest of the file, should I be looking for other lines that need to be fixed? Man, I'm so confused...