Versuche, eine php Abfrage in einer Seite auszugeben, habe es im html Modus mittels versucht, klappt aber nicht. Wie kann ich sowas realisieren? Hat jemand einen Tipp für mich?
Hier ist der Code:
ZitatAlles anzeigen[FONT=Arial]<?php[/FONT]
[FONT=Arial][/FONT][FONT=Arial]header('Content-Type: text/html; charset=UTF-8'); [/FONT]
[FONT=Arial][/FONT][FONT=Arial]require_once('HTTP/Request.php');[/FONT]
[FONT=Arial]$req =& new HTTP_Request('http://api.immobilienscout24.de/api/xmlhttp/SessionService'); [/FONT]
[FONT=Arial]$req->setMethod(HTTP_REQUEST_METHOD_POST);[/FONT]
[FONT=Arial]$content = '<?xml version="1.0" encoding="UTF-8" ?> [/FONT]
[FONT=Arial]<CreateSessionRequest xmlns="http://www.immobilienscout24.de/api/schema/general/1.0">[/FONT]
[FONT=Arial] <accesskey>Ihr Freischaltcode/API-Key</accesskey>[/FONT]
[FONT=Arial] [/FONT][FONT=Arial]<vendor>Ihre VendorID/ScoutID/Kundennummer</vendor>[/FONT]
[FONT=Arial]</CreateSessionRequest>';[/FONT]
[FONT=Arial]$req->addRawPostData($content);[/FONT]
[FONT=Arial]$response = $req->sendRequest();[/FONT]
[FONT=Arial]print_r(htmlspecialchars($req->getResponseBody()));[/FONT]
[FONT=Arial]?>[/FONT]