Hi Snarf,
Het doel is dus gewoon variabelen tonen?
De rest zijn tenslotte allemaal afbeeldingen, die je er met een
![]()
in je website kan plaatsen.
Waarom maak je geen tweede customtext.txt file?
Neem deze txt file, die een customtextout11.txt creëert:
customtext11.txt
Code: Selecteer alles<?php
$stationDate = "%date%";
$stationTime = "%time%";
$windDirection = "%dirlabel%";
$sunriseTime = "%sunrise%";
$sunsetTime = "%sunset%";
$outsideTemp = "%temp%";
$hiOutsideTemp = "%maxtemp%";
$lowOutsideTemp = "%mintemp%";
$lowOutsideTempTime = "%mintempt%";
$hiOutsideTempTime = "%maxtempt%";
$lowMonthlyOutsideTemp = "%monthtodatemintemp%";
$hiMonthlyOutsideTemp = "%monthtodatemaxtemp%";
$hiYearlyOutsideTemp = "%yrecordhightemp%";
$lowYearlyOutsideTemp = "%yrecordlowtemp%";
$outsideHumidity = "%hum%";
$lowHumidity = "%lowhum%";
$hiHumidity = "%highhum%";
$lowHumTime = "%lowhumt%";
$hiHumTime = "%highhumt%";
$hiMonthlyHumidity = "%mrecordhighhum%";
$lowMonthlyHumidity = "%mrecordlowhum%";
$hiYearlyHumidity = "%yrecordhighhum%";
$lowYearlyHumidity = "%yrecordlowhum%";
$outsideDewPt = "%dew%";
$hiDewpoint = "%maxdew%";
$lowDewpoint = "%mindew%";
$hiDewpointTime = "%maxdewt%";
$lowDewpointTime = "%mindewt%";
$hiMonthlyDewpoint = "%mrecordhighdew%";
$lowMonthlyDewpoint = "%mrecordlowdew%";
$hiYearlyDewpoint = "%yrecordhighdew%";
$lowYearlyDewpoint = "%yrecordlowdew%";
$windSpeed = "%gstspd%";
$wind10Avg = "%avtenminutewind%";
$hiWindSpeed = "%maxgst%";
$hiWindSpeedTime = "%maxgstt%";
$hiMonthlyWindSpeed = "%mrecordwindgust%";
$hiYearlyWindSpeed = "%yrecordwindgust%";
$windDir = "%dirdeg%";
$windDirection = "%dirlabel%";
$windChill = "%windch%";
$lowWindchill = "%minwindch%";
$lowWindchillTime = "%minwindcht%";
$lowMonthlyWindchill = "%mrecordlowchill%";
$lowYearlyWindchill = "%yrecordlowchill%";
$outsideHeatIndex = "%heati%";
$hiHeatindex = "%maxheat%";
$hiHeatindexTime = "%maxheatt%";
$hiMonthlyHeatindex = "%mrecordhighheatindex%";
$hiYearlyHeatindex = "%yrecordhighheatindex%";
$hiTHSWindex = "%THSW%";
$hiTHSWindexTime = "%hiTHSW%";
$hiMonthlyTHSWindex = "%mrecordhighthsw%";
$hiYearlyTHSWindex = "%yrecordhighthsw%";
$barometer = "%baro%";
$barTrend = "%pressuretrendname%";
$lowBarometer = "%lowbaro%";
$hiBarometer = "%highbaro%";
$lowMonthlyBarometer = "%mrecordlowbaro%";
$hiMonthlyBarometer = "%mrecordhighbaro%";
$lowYearlyBarometer = "%yrecordlowbaro%";
$hiYearlyBarometer = "%yrecordhighbaro%";
$lowBarometerTime = "%lowbarot%";
$hiBarometerTime = "%highbarot%";
$dailyRain = "%dayrn%";
$monthlyRain = "%monthrn%";
$totalRain = "%yearrn%";
$rainRate = "%currentrainrate%";
$hiRainRate = "%maxrainrate%";
$hiRainRateTime = "%maxrainratetime%";
$hiRainRateHour = "%currentrainratehr%";
$solarRad = "%VPsolar%";
$hiSolarRad = "%highsolar%";
$hiSolarRadTime = "%highsolartime%";
$hiMonthlySolarRad = "%mrecordhighsolar%";
$hiYearlySolarRad = "%yrecordhighsolar%";
$uv = "%VPuv%";
$hiUV = "%highuv%";
$hiUVTime = "%highuvtime%";
$hiMonthlyUV = "%mrecordhighuv%";
$hiYearlyUV = "%yrecordhighuv%";
$forecast = "%vpforecasttext%";
$wdversion = "%wdversion%"
?>
D.m.v. een PHP include kun je variabelen in HTML opvragen uit je txt file.
HTML pagina:Code: Selecteer alles<!doctype html>
<html lang="nl">
<head>
<title>Snarf's eerste pagina</title>
</head>
<body>
<?php include('../weerdata/customtextout11.txt'); ?>
<?php echo $outsideTemp; ?>
</body>
</html>