0

While the data I have taken with XML on localhost is working, the page does not work completely when I throw it to the hosting. Not only the XML code, but also other php and html codes are disabled. Has anyone encountered such a problem before? if so can you help?

php codes `

$link="https://www.tcmb.gov.tr/kurlar/today.xml";
    
    $icerik=simplexml_load_file($link);
    
    
    /*echo "<pre>";
    
    print_r($icerik);
    
    echo "</pre>";*/
    
    
    $usd_kodu=$icerik->Currency[0]["CurrencyCode"];
    $Usd_adi=$icerik->Currency[0]->Isim;
    $Usd_birim=$icerik->Currency[0]->Unit;
    $Usd_alis=$icerik->Currency[0]->ForexBuying;    
    $Usd_satis=$icerik->Currency[0]->ForexSelling;  
    $Usd_efektifAlis=$icerik->Currency[0]->BanknoteBuying;      
    $Usd_efektifSatis=$icerik->Currency[0]->BanknoteSelling;
    $usd_id=1; // veri tabanı idleri xml ile çekilmedi

` html codes

`

 <tr>
            <th width="133" height="36" align="center" style="font-style: normal; font-weight: bold; font-size: large;" scope="col">Döviz Kuru</th>
            <th width="113" align="center" style="font-style: normal" scope="col">Adı</th>
             <th width="113" align="center" style="font-style: normal" scope="col">Kodu</th>
            <th width="113" align="center" style="font-style: normal" scope="col">Birimi</th>
            <th width="118" align="center" style="font-style: normal" scope="col">Alış Fiyatı</th>
            <th width="130" align="center" style="font-style: normal" scope="col">Satış Fiyatı</th>
            <th width="99" align="center" style="font-style: normal" scope="col">Efektif Alış</th>
            <th width="119" align="center" style="font-style: normal" scope="col">Efektif Fiyatı</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <th rowspan="3" align="center" valign="middle" style="font-size: medium" scope="row">TCMB</th>
            <td height="51" align="center"><?php echo $Usd_adi;   ?></td>
             <td height="51" align="center"><?php echo $usd_kodu;   ?></td>
            <td align="center"><?php echo $Usd_birim; ?></td>
            <td align="center"><?php echo $Usd_alis;   ?></td>
            <td align="center"><?php echo $Usd_satis;    ?></td>
            <td align="center"><?php echo $Usd_efektifAlis;    ?></td>
            <td align="center"><?php echo $Usd_efektifSatis;    ?></td>
          </tr>

`

I was hoping the codes would work on hosting as well as on localhost but it didn't

  • 1
    Could you explain what you mean by *Not only the XML code, but also other php and html codes are disabled*. – Nigel Ren Dec 27 '22 at 12:26
  • it does not show other codes in the same page, it gives blank page output regardless of which code it is. – Tayfun Çınar Dec 27 '22 at 12:27
  • 1
    @TayfunÇınar have a look at [How do I get PHP errors to display](https://stackoverflow.com/questions/1053424/how-do-i-get-php-errors-to-display) - Blank page usually means you have an error and error reporting in the browser is off. – Uwe Dec 27 '22 at 12:50
  • And if that is the case, bring back your error message and [edit](https://stackoverflow.com/posts/74929230/edit) your question. – Uwe Dec 27 '22 at 13:06

1 Answers1

0

Is SimpleXML support enabled on your hosting? You can check it with

phpinfo();

Also make sure you have a valid ssl certification