Précédent   Forum des professionnels en informatique > PHP > Bibliothèques et frameworks > XML
XML Forum d'entraide sur XML avec PHP. Exemples : SimpleXML, OpenXML... Avant de poster -> FAQ XML, Cours XML et Sources XML
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 13/07/2007, 14h34   #1
Invité régulier
 
Inscription : mai 2002
Messages : 45
Détails du profil
Informations forums :
Inscription : mai 2002
Messages : 45
Points : 8
Points : 8
Par défaut Balise <?xml

bonjour à tous,
j'ai mise en forme un fichier html et j'aimerais le transformer en fichier .php afin d'utiliser certaines fonctions de PHP.
mais j'ai une erreur sur la première ligne <?xml version="1.0"?>
il l'a prend comme du code PHP à cause des <? ?>
je suis débutant et ne trouve pas la solution - Avez vous une idée ?
merci

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="content-language" content="cs" />
    <meta name="robots" content="all,follow" />
 
    <meta name="author" content="All: ... [Nazev webu - www.url.cz]; e-mail: info@url.cz" />
    <meta name="copyright" content="Design/Code: Vit Dlouhy [Nuvio - www.nuvio.cz]; e-mail: vit.dlouhy@nuvio.cz" />
 
    <title>CrystalX</title>
    <meta name="description" content="..." />
    <meta name="keywords" content="..." />
 
    <link rel="index" href="./" title="Home" />
    <link rel="stylesheet" media="screen,projection" type="text/css" href="./css/main.css" />
    <link rel="stylesheet" media="print" type="text/css" href="./css/print.css" />
    <link rel="stylesheet" media="aural" type="text/css" href="./css/aural.css" />
</head>
 
<body id="www-url-cz">
 
<!-- Main -->
<div id="main" class="box">
 
    <!-- Header -->
 
 
  <div id="header"> 
    <!-- Logotyp -->
    <h1 id="logo"><a href="./" title="CrystalX [Go to homepage]"><strong>SOGICOM</strong><span></span></a></h1>
    <hr class="noscreen" />
    <!-- Quick links -->
    <div class="noscreen noprint"> 
      <p><em>Quick links: <a href="#content">content</a>, <a href="#tabs">navigation</a>, 
        <a href="#search">search</a>.</em></p>
      <hr />
    </div>
    <!-- Search -->
    <div id="search" class="noprint"> 
      <form action="" method="get">
        <fieldset>
        <legend>Search</legend>
        <label><span class="noscreen">Find:</span> <span id="search-input-out"> 
        <input type="text" name="" id="search-input" size="30" />
        </span></label>
        <input type="image" src="design/search_submit.gif" id="search-submit" value="OK" />
        </fieldset>
      </form>
    </div>
    <!-- /search -->
  </div>
  <!-- /header -->
 
     <!-- Main menu (tabs) -->
     <div id="tabs" class="noprint">
 
            <h3 class="noscreen">Navigation</h3>
            <ul class="box">
 
 
      <li id="active"><a href="./index.html">Accueil<span class="tab-l"></span><span class="tab-r"></span></a></li>
manplum est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 13/07/2007, 14h40   #2
Membre Expert
 
Inscription : janvier 2005
Messages : 2 288
Détails du profil
Informations forums :
Inscription : janvier 2005
Messages : 2 288
Points : 2 287
Points : 2 287
dans ton php.ini tu dois avoir une directive "short open tags" qui est a ON
ca veut dire que tu autorises autant <?php que <?
et du coup ca pose probleme, si tu passes cette directive a OFF tu devrais contourner ce probleme (et ton code php devra toujours commencer par <?php )
koopajah est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 13/07/2007, 16h06   #3
Invité régulier
 
Inscription : mai 2002
Messages : 45
Détails du profil
Informations forums :
Inscription : mai 2002
Messages : 45
Points : 8
Points : 8
ok cela fonctionne, mais comment faire chez mon hebergeur ?
merci
manplum est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 13/07/2007, 19h36   #4
Membre expérimenté
 
Inscription : septembre 2006
Messages : 685
Détails du profil
Informations forums :
Inscription : septembre 2006
Messages : 685
Points : 564
Points : 564
Tente avec un ini_set() ou php flag dans un fichier .htaccess

Sinon, change d'hébergeur

Est-ce que tu as vraiment la nécessité d'utiliser un xml version ?
Xunil est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 14/07/2007, 02h35   #5
Membre du Club
 
Inscription : août 2003
Messages : 49
Détails du profil
Informations forums :
Inscription : août 2003
Messages : 49
Points : 50
Points : 50
Bonjour,

Il y a aussi:
Code :
1
2
3
4
<?php
echo ('<?xml version="1.0"?>'."\n");
?>
// ici la suite du html
++
Snowboarder69 est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 17h01.


 
 
 
 
Partenaires

Hébergement Web