I didn't go through the whole forum, I'm too tired to find an answer this way...
my problem: I'd like to include the query of my database (abfrage.php; it ends up with an url) into my index.php.
Now, everything's doing fine except the fact that there's neither the footer.php nor the header.php anymore.
I think I have to modify the header(Location: ..) tag, but I don't know how.
my index.php
<?php
if (!eregi("modules.php", $PHP_SELF)) {
die ("You can't access this file directly...");
}
if (!isset($mainfile)) { include("mainfile.php"); }
$module_name = basename(dirname(FILE));
get_lang($module_name);
$index=0;
include("header.php");
OpenTable();
include("/modules/Test/abfrage.php");
CloseTable();
include("footer.php");
?>
my abfrage.php
<?php
$linkid = $_GET['lid'];
$connection = mysql_connect("localhost", "user", "pass") or die("Could not connect: " . mysql_error());
$db = mysql_select_db("nuke.nuke_mainlinks", $connection);
$result = mysql_query("SELECT * WHERE lid=".$linkid) or die("Invalid query: " . mysql_error());
$row = mysql_fetch_array($result);
$url = $row[url];
mysql_close($connection);
header("Location: $url");
?>