The main requirement was that in the end, it should be possible for a person without programming experience to provide content and photos on the website.
I come to the conclusion that Wordpress is an alternative. I installed a web server and a MySQL database and tried it out first. After a few adjustments and additions coded in PHP, I showed it to my client. He agreed with it. The biggest benefit of Wordpress is that it takes no programming experience to the user. The last step was to register a free web space and a domain.
There exists a Drupal-Module called Views. It is available for Drupal 5 through 7. It is able to output a site's data in XML (or RSS) format. That way a machine-readable format of the first site's data can be created.
For the other site a Drupal Module could be created that reads the XML file and formats it for output the way desired.
The challenge was to get a public transport route, by sending time, date, start and destination address. The problem was solved by using the "Wiener Linien API" (http://akirk.github.com/Wiener-Linien-API/). The PHP-Code sends a XML-request with all details of the appointment and get a XML-respond with the transport connection.
For building a request the PHP-function "buildRequest()" can be used.
The following example illustrates a query from "Seckendorfstrasse 4" to "Wiedner Hauptstr. 8":
$params = array();
$params["outputCoords"] = "WGS84";
$params["from"] = "Seckendorfstrasse 4";
$params["to"] = "Wiedner Hauptstr. 8";
$params["year"] = "2011";
$params["month"] = "12";
$params["day"] = "14";
$params["hour"] = "17";
$params["minute"] = "00";
$params["deparr"] = "arr";
$params["modality"] = "pt";
$params["sourceFrom"] = "gps";
$params["sourceTo"] = "stoplist";
$req = buildRequest("api_get_route", $params);
Afterwards, the XML-request must be sent to the following webservice: http://webservice.qando.at/2.0/webservice.ft.
$response = httpPost("http://webservice.qando.at/2.0/webservice.ft", $req);
Finally, the XML-response must be load into a Document Object Model (DOM). A DOM presents an XML document as a tree-structure, which makes it easy to interpret and evaluate the local public transport route.
$dom = new DOMDocument();
$dom->formatOutput = true;
$dom->preserveWhiteSpace = false;
$dom->loadXML($response);
The complete DOMDocument manual is available on the website: http://php.net/manual/de/class.domdocument.php.
To print out the XML-response of the public transport route, use the following PHP-code:
echo "Response: " .$dom->saveXML(). "";
The problem was solved by the creation of the PHP mail()-function.
Programmers have to include the receiver or receivers, subject, message, header (From, Cc, and Bcc) and optional parameter of the eMail.
The syntax of the mail()-function is mail(to,subject,message,headers,parameters)
.
For an example, see "Screenshot PHP Mail-Function" or the following code-snippet:
<?php
$to = "somebody@example.com";
$subject = "test subject";
$txt = "Hello world!";
$headers = "From: from@example.com" . "\r\n" .
"CC: cc@example.com";
mail($to,$subject,$txt,$headers);
?>