Seite 1 von 1

Error bei Aufruf einer Seite

Verfasst: 24.05.2011 18:22
von Kiss News
Hallo!

Ich habe auf meinem Webspace bei Host Europe die files "APIcall.php"

Code: Alles auswählen

<!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" xml:lang="de" lang="de">

<head>
    <title>Kiss Calls</title>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <meta name="description" content="" />
    <meta name="author" content="" />
    <meta name="keywords" content="" />
    <meta name="generator" content="Webocton - Scriptly (www.scriptly.de)" />

    <link rel="stylesheet" type="text/css" media="screen" href="style.css"/>
    <base target="_blank">

</head>

<body>

<?php


// API request variables
    $endpoint = 'http://svcs.ebay.com/services/search/FindingService/v1';
    $version = '1.0.0';
    $appid = 'affiline-edd5-45ad-a9de-42e75eb561b7';
    $globalid = 'EBAY-DE';


    $query = 'Kiss Action Figur';


    $safequery = urlencode($query);
    $i = '0';

// Construct the findItemsByKeywords HTTP GET call
    $apicall = "$endpoint?";
    $apicall .= "OPERATION-NAME=findItemsAdvanced";
    $apicall .= "&SERVICE-VERSION=$version";
    $apicall .= "&SECURITY-APPNAME=$appid";
    $apicall .= "&GLOBAL-ID=$globalid";
    $apicall .= "&keywords=$safequery";

    $apicall .= "&paginationInput.entriesPerPage=1";

   // $apicall .= "&categoryId=3034";

    $apicall .= "&affiliate.networkId=9";
    $apicall .= "&affiliate.trackingId=1234567890";
    $apicall .= "&affiliate.customId=456";

    $apicall .= "&itemFilter(0).name=ListingType&itemFilter(0).value=FixedPrice";


// Load the call and capture the document returned by eBay API
    $resp = simplexml_load_file($apicall);

// Check to see if the request was successful, else print an error
    if ($resp->ack == "Success") {
    $results = '';
    $results2 = '';
    $results3 = '';


// If the response was loaded, parse it and build links
    foreach($resp->searchResult->item as $item) {
        $pic   = $item->galleryURL;
        $link  = $item->viewItemURL;
        $title = $item->title;
        $price = $item->sellingStatus->convertedCurrentPrice;

// For each SearchResultItem node, build a link and append it to $results
   if ($pic != ""){

    $results .= "<a href=\"$link\"><img src=\"$pic\"></a>";
    $results2 .= "<a href=\"$link\">$title</a>";
    $results3 .="<a \"$price\">$price Euro</a>  ";  }

}}



?>

<div id="main">

<div id="pic">
<?php echo $results; ?>
</div>

<div id="preis">
 <?php echo $results3;?>
</div>

<div id="text">
 <?php echo $results2; ?>
</div>




</div>


</body>
</html>
als auch "styles.css" hochgeladen:

Code: Alles auswählen

table {

    border-collapse:collapse;
}

td {
    background-color: #808080;
    border: solid 10px #FFFFFF;
    width: 60px;
    height: 60px;
    font-size: small;
    font-family: Tahoma;
}
img {
    width: 60px;
    height: 60px;
    margin-left: 5px;
    margin-top: 5px;
    }


#main {
    border: solid 2px black;
    width: 120px;
    height: 115px;
    padding: 2px;
}

#pic {

      height: 65px;
      width: 65px;
      border:  solid 1px black;
      margin-right: 5px;
      float: left;
     }

#preis {
   font-size: 8px;
   width: 40px;
   height: 10px;
   border:  solid 1px black;
   margin-top: 25px;
   padding: 2px;
   float: left;

   }




#text {
   font-size: 8px;
   width: 110px;
   height: 34px;
   border:  solid 1px black;
   margin-top: 5px;
   padding: 2px;
   float: left;
}
Wenn ich die Seite aufrufe, sieht das so aus:
http://www.kissforum.de/API/APIcall.php

Wenn ich allerdings genau dieselben Dateien auf meinem Strato Server hochlade, kommt ein Error:
Fatal error: Call to undefined function: simplexml_load_file() in /mnt/web9/30/25/5678425/htdocs/API/APIcall.php on line 56
http://www.kissnews.de/API/APIcall.php

Liegt das jetzt am Server oder wo liegt der Fehler?

Danke!

Re: Error bei Aufruf einer Seite

Verfasst: 24.05.2011 18:38
von Balint
Kiss News hat geschrieben:Liegt das jetzt am Server oder wo liegt der Fehler?
Hallo,

auf deinem Strato Server fehlt wohl die SimpleXML-Erweiterung: http://www.php.net/manual/de/intro.simplexml.php - aber wenn du einen Server betreibst, weisst du sicherlich, wie man das behebt.


Viele Grüße,
Bálint

Re: Error bei Aufruf einer Seite

Verfasst: 24.05.2011 19:12
von Kiss News
Danke für die Info. Ich habe mich da schlecht ausgedrückt. Ich betreibe bei Strato keinen eigenen Server, sondern habe dort lediglich einen Webspace mit meinem "Powerplus" Paket.

Re: Error bei Aufruf einer Seite

Verfasst: 24.05.2011 19:37
von Balint
Kiss News hat geschrieben:Danke für die Info. Ich habe mich da schlecht ausgedrückt. Ich betreibe bei Strato keinen eigenen Server, sondern habe dort lediglich einen Webspace mit meinem "Powerplus" Paket.
Hallo,

na dann müsstest du im Leistungsumfang dieses Paketes mal schauen, wieso das fehlt, ggf. mit einer sog. phpinfo-Datei nachschauen, ob die Erweiterung wirklich fehlt (sie ist nämlich standardmäßig in PHP enthalten) und ggf. deinen Hoster kontaktieren, damit er dir diese Erweiterung zur Verfügung stellt.


Viele Grüße,
Bálint

Re: Error bei Aufruf einer Seite

Verfasst: 24.05.2011 19:59
von Kiss News
Danke für die Info.
Also bei Strato steht nichts von SimpleXML
http://www.kissnews.de/phpinfo.php

Bei Host Europe hingegen schon:
http://www.kissforum.de/phpinfo.php

Strato habe ich bereits kontaktiert...

Re: Error bei Aufruf einer Seite

Verfasst: 25.05.2011 11:13
von Kiss News
Von Strato habe ich noch keine Antwort.
Habe inzwischen versucht, das in einer HTML-Seite aufzurufen, da es in einer HTML-Seite eingebaut werden soll, aber das funktioniert nicht:
http://www.kissforum.de/API/TestAPIcall2.htm

es erscheint gar nichts.

Code: Alles auswählen

 
<html>
 
<head>
<title></title>
</head>
<?php include_once "APIcall.php"; echo $results; ?>
<?php include_once "http://www.kissforum.de/API/APIcall.php"; echo $results; ?>
<body>
</body>
</html>
Was mache ich falsch?
Danke!

Re: Error bei Aufruf einer Seite

Verfasst: 31.05.2011 09:13
von FCM
Bitte setze oben mal ein

Code: Alles auswählen

error_reporting(E_ALL);
,

damit wir eventuell auftretende Fehler bzw. Warnungen sehen können.

Re: Error bei Aufruf einer Seite

Verfasst: 31.05.2011 15:55
von Elsensee
Der PHP-Interpreter springt nicht ein, wenn eine HTML-Seite aufgerufen wird - dies muss in der .htaccess eingestellt werden.

Re: Error bei Aufruf einer Seite

Verfasst: 31.05.2011 17:23
von Kiss News
Vielen Dank für Eure Antworten!