Nothing happens if I paste this in my htaccess file, the Code from the Module is:
{source}
<?php
if(!$dbconn){
require "myphpfiles/config.php";
require "myphpfiles/library.php";
}
require "myphpfiles/IMKO_WetterstationModule.php";
?>
{/source}
config.php
<?php
function weatherconn(){
$dbconn = @pg_connect("host=HOST port=PORT user=USER password=PASSWORD dbname=DATABASE");
if (!$dbconn){
throw new Exception();
}
else return $dbconn;
}
try {
$dbconn = weatherconn();
} catch (Exception $e){ echo "";}
?>
library.php
<?php
if($dbconn){
$starttime = pg_query ("SELECT MAX(starttime) FROM imko.mod_data");
$starttime_fetch = pg_fetch_array($starttime);
$windvelocity = pg_query ("SELECT value,unit FROM imko.v_plot WHERE serno='5032' AND channel='1' AND starttime='$starttime_fetch[0]'");
$windvelocity_fetch = pg_fetch_array($windvelocity);
$globalradiation = pg_query ("SELECT value,unit FROM imko.v_plot WHERE serno='12922' AND channel='1' AND starttime='$starttime_fetch[0]'");
$globalradiation_fetch = pg_fetch_array($globalradiation);
$winddirection = pg_query ("SELECT value,unit FROM imko.v_plot WHERE serno='5524' AND channel='2' AND starttime='$starttime_fetch[0]'");
$winddirection_fetch = pg_fetch_array($winddirection);
$airpressure = pg_query ("SELECT value,unit FROM imko.v_plot WHERE serno='12920' AND channel='1' AND starttime='$starttime_fetch[0]'");
$airpressure_fetch = pg_fetch_array($airpressure);
$relhumidity = pg_query ("SELECT value,unit FROM imko.v_plot WHERE serno='3874' AND channel='2' AND starttime='$starttime_fetch[0]'");
$relhumidity_fetch = pg_fetch_array($relhumidity);
$airtemperature = pg_query ("SELECT value,unit FROM imko.v_plot WHERE serno='3874' AND channel='1' AND starttime='$starttime_fetch[0]'");
$airtemperature_fetch = pg_fetch_array($airtemperature);
$cumulprecipitation = pg_query ("SELECT value,unit FROM imko.v_plot WHERE serno='12921' AND channel='1' AND starttime='$starttime_fetch[0]'");
$cumulprecipitation_fetch = pg_fetch_array($cumulprecipitation);
$precipitation = pg_query ("SELECT value,unit FROM imko.v_plot WHERE serno='12921' AND channel='2' AND starttime='$starttime_fetch[0]'");
$precipitation_fetch = pg_fetch_array($precipitation);
$batteryampere = pg_query ("SELECT value,unit FROM imko.v_plot WHERE serno='5780' AND channel='1' AND starttime='$starttime_fetch[0]'");
$batteryampere_fetch = pg_fetch_array($batteryampere);
$batteryvolt = pg_query (" SELECT value,unit FROM imko.v_plot WHERE serno='5780' AND channel='2' AND starttime='$starttime_fetch[0]'");
$batteryvolt_fetch = pg_fetch_array($batteryvolt);
$volwatercontent = pg_query ("SELECT value,unit FROM imko.v_plot WHERE serno='30272' AND channel='1' AND starttime='$starttime_fetch[0]'");
$volwatercontent_fetch = pg_fetch_array($volwatercontent);
$soiltemperature = pg_query ("SELECT value,unit FROM imko.v_plot WHERE serno='30272' AND channel='2' AND starttime='$starttime_fetch[0]'");
$soiltemperature_fetch = pg_fetch_array($soiltemperature);
$tdrlevel = pg_query ("SELECT value,unit FROM imko.v_plot WHERE serno='30272' AND channel='3' AND starttime='$starttime_fetch[0]'");
$tdrlevel_fetch = pg_fetch_array($tdrlevel);
}else{}
?>
IMKO_WetterstationModule.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>IMKO Wetterstation</title>
<link type="text/css" href="/myphpfiles/css/style.css" rel="stylesheet">
</head>
<body>
<?php if($dbconn){ ?>
<div id="mainWeather">
<div id="dateModule" style="padding-left: 5px;">
<?php
echo '<span class="bold">Last Update:<br /></span>'.$starttime_fetch[0].''
?>
</div>
<div id="pictureModule">
<a href="index.php/de/produkte/umweltmonitoring/imko-wetterstation" title="IMKO Wetterstation"><img class="Kontu_Rahmen_IMKOgelb" style="margin-left: 9px;" src="images/stories/products/localweather/IMKO_envis_start.jpg" border="0" alt="IMKO_ENVIS" vspace="3" width="160" height="186" /></a>
</div>
<div id="titleModule" style=" padding-left: 5px;">
<span class="titleModule bold"> Wind Velocity:</span><br />
<span class="titleModule bold"> Water Content:</span><br />
<span class="titleModule bold"> Soil Temerature:</span><br />
</div>
<div id="valueModule">
<span class="valueModule"><?php echo $windvelocity_fetch[0]." ".$windvelocity_fetch[1] ?></span><br />
<span class="valueModule"><?php echo $volwatercontent_fetch[0]." ".$volwatercontent_fetch[1] ?></span><br />
<span class="valueModule"><?php echo $soiltemperature_fetch[0]." ".$soiltemperature_fetch[1] ?></span><br />
</div>
</div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="background-color: #dfdfdf; padding: 5px;">Hier bekommen Sie einen Überblick über alle Sensoren <a href="http://globelog.de/index.php/de/produkte/umweltmonitoring/imko-wetterstation">...mehr</a></td>
</tr>
</table>
<?php }else{
} ?>
</body>
</html>
dosn't seem to be wrong for me. And of course, the 100% same code works for me at globelog.de, the devserver even show a blank page if I just use:
<?php
echo "Test";
?>