IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

HTML Discussion :

Ouvrir une page dans une nouvelle fenêtre ou un nouvel onglet


Sujet :

HTML

  1. #1
    Membre du Club
    Profil pro
    Inscrit en
    Février 2007
    Messages
    219
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2007
    Messages : 219
    Points : 61
    Points
    61
    Par défaut Ouvrir une page dans une nouvelle fenêtre ou un nouvel onglet
    Bonjour,
    J'ai une page HTML avec un form en méthode POST (car j'ai besoin de données dans la page suivante). Je voudrais donc en cliquant sur mon bouton envoyer ouvrir ma page pdf dans une nouvelle fenêtre ou un nouvel onglet. Comment faire car j'ai trouvé window.open() mais cela ne prend pas en compte mes $_POST['...']???

  2. #2
    Rédacteur

    Avatar de zoom61
    Homme Profil pro
    ...
    Inscrit en
    Janvier 2005
    Messages
    9 429
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Vienne (Limousin)

    Informations professionnelles :
    Activité : ...
    Secteur : Industrie

    Informations forums :
    Inscription : Janvier 2005
    Messages : 9 429
    Points : 58 222
    Points
    58 222
    Billets dans le blog
    11
    Par défaut
    Salut,

    Normalement, avec la commande :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <a href="..." target="_blank">...</a>
    @+.

  3. #3
    Membre du Club
    Profil pro
    Inscrit en
    Février 2007
    Messages
    219
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2007
    Messages : 219
    Points : 61
    Points
    61
    Par défaut
    Mais j'ai un bouton. Je peux pas y mettre en bouton ça ??et ça prends mes $_POST??

  4. #4
    Rédacteur

    Avatar de zoom61
    Homme Profil pro
    ...
    Inscrit en
    Janvier 2005
    Messages
    9 429
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Vienne (Limousin)

    Informations professionnelles :
    Activité : ...
    Secteur : Industrie

    Informations forums :
    Inscription : Janvier 2005
    Messages : 9 429
    Points : 58 222
    Points
    58 222
    Billets dans le blog
    11
    Par défaut
    Désolé, j'avais pa vu pour le bouton :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <input target="_blank" type="button">...</input>
    Cela devrait fonctionner.

    Et cela prend bien en compte les $_POST.

  5. #5
    Membre du Club
    Profil pro
    Inscrit en
    Février 2007
    Messages
    219
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2007
    Messages : 219
    Points : 61
    Points
    61
    Par défaut
    En fait j'ai ça:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    <input type="submit" target="_blank" value="Visualiser la page au format pdf">
    </form>
    Mais ça marche pas...

  6. #6
    Rédacteur

    Avatar de zoom61
    Homme Profil pro
    ...
    Inscrit en
    Janvier 2005
    Messages
    9 429
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Vienne (Limousin)

    Informations professionnelles :
    Activité : ...
    Secteur : Industrie

    Informations forums :
    Inscription : Janvier 2005
    Messages : 9 429
    Points : 58 222
    Points
    58 222
    Billets dans le blog
    11
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <input type="submit" target="_blank" value="Visualiser la page au format pdf">...</input>
    Il manque </input>

  7. #7
    Membre du Club
    Profil pro
    Inscrit en
    Février 2007
    Messages
    219
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2007
    Messages : 219
    Points : 61
    Points
    61
    Par défaut
    Mais je met quoi entre <input ...> et </input> car moi j'ai un <form> Et là ça ne marche pas, du moins ça ne l'ouvre pas dans une nouvelle fenêtre

  8. #8
    Rédacteur

    Avatar de zoom61
    Homme Profil pro
    ...
    Inscrit en
    Janvier 2005
    Messages
    9 429
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Vienne (Limousin)

    Informations professionnelles :
    Activité : ...
    Secteur : Industrie

    Informations forums :
    Inscription : Janvier 2005
    Messages : 9 429
    Points : 58 222
    Points
    58 222
    Billets dans le blog
    11
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    <form>
    ...
    <input type="submit" target="_blank" value="Visualiser la page au format pdf">...</input>
    ...
    </form>

  9. #9
    Membre du Club
    Profil pro
    Inscrit en
    Février 2007
    Messages
    219
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2007
    Messages : 219
    Points : 61
    Points
    61
    Par défaut
    Bah ça ne marche pas. ça l'ouvre quand même mais dans le même onglet

  10. #10
    Rédacteur

    Avatar de zoom61
    Homme Profil pro
    ...
    Inscrit en
    Janvier 2005
    Messages
    9 429
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Vienne (Limousin)

    Informations professionnelles :
    Activité : ...
    Secteur : Industrie

    Informations forums :
    Inscription : Janvier 2005
    Messages : 9 429
    Points : 58 222
    Points
    58 222
    Billets dans le blog
    11
    Par défaut
    Peux-tu mettre ton code ?

  11. #11
    Membre du Club
    Profil pro
    Inscrit en
    Février 2007
    Messages
    219
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2007
    Messages : 219
    Points : 61
    Points
    61
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    <form name="vente_hebdo" method="POST" action="./pdf/pdf_hebdo.php">
     
    Volumes de ventes réalisés en semaine <?=$ww?>
     
    <?php //Création du tableau des ventes hebdomadaires ?>
    <table width=* border=1 cellspacing=0 cellpadding=5>
    <tr align=center valign=center>
      <td rowspan=2><strong>Semaine <?=$ww;?></strong></td>
    <?
    $sql = "SELECT * FROM regions ORDER BY regions_id;";
    $result = mysql_query($sql);
    $nbreg = 0;
    while ($rs = mysql_fetch_array($result)) {
      $nbreg++;
      $treg[$nbreg] = $rs['regions_id'];
      $regions_nom = $rs['regions_nom'];
      echo("<td colspan=2><strong>$regions_nom</strong></td>");
      $tfra[$nbreg] = 0;
      $texp[$nbreg] = 0;
    }
    $tvar = array('NB','nb','NJ','nj','PB','pb','PJ','pj');
    ?>
      <td colspan=2><strong>Total</strong></td>
    </tr>
    <? for ($n=1;$n<=$nbreg+1;$n++) { ?>
      <td><strong>France</strong></td>
      <td><strong>Export</strong></td>
    <? } ?>
     
    <?
    for ($n=1;$n<=4;$n++) {
      $tmpfra = "volh_".$tvar[($n*2)-1]."_fra";
      $tmpexp = "volh_".$tvar[($n*2)-1]."_exp";
      $var = $tvar[($n-1)*2];
      echo("<tr align=center>");
      echo("<td><strong>$var</strong></td>");
      $totfra = 0;
      $totexp = 0;
      for ($m=1;$m<=$nbreg;$m++) {
        $reg = $treg[$m];
        $sql2 = "SELECT SUM($tmpfra) AS fra, SUM($tmpexp) AS exp FROM volh, operateurs WHERE volh.operateurs_id = operateurs.operateurs_id AND volh_ss = $ww AND regions_id = $reg;";
        $rs2 = mysql_fetch_array(mysql_query($sql2));
        $fra = $rs2['fra']*1;
        $exp = $rs2['exp']*1;
        $totfra = $totfra + $fra;
        $totexp = $totexp + $exp;
        $tfra[$m] = $tfra[$m] + $fra;
        $texp[$m] = $texp[$m] + $exp;
        echo("<td>$fra</td>");
        echo("<td>$exp</td>");
      }
      echo("<td><strong>$totfra</strong></td>");
      echo("<td><strong>$totexp</strong></td>");
      echo("</tr>");
    }
    ?>
    <tr align=center>
      <td><strong>TOTAL</strong>
    <?
    $totfra = 0;
    $totexp = 0;
    for ($n=1;$n<=$nbreg;$n++) {
      $f = $tfra[$n];
      $e = $texp[$n];
      $totfra = $totfra + $f;
      $totexp = $totexp + $e;
      echo("<td><strong>$f</strong></td>");
      echo("<td><strong>$e</strong></td>");
    }?>
      <td><strong><?=$totfra;?></strong></td>
      <td><strong><?=$totexp;?></strong></td>
    </tr>
    <tr align=center>
      <td><strong>%</strong></td>
    <?
    for ($n=1;$n<=$nbreg;$n++) {
       if (($totfra+$totexp)<>0){
      $pfra = round(100*$totfra/($totfra+$totexp),0);
      $pexp = round(100*$totexp/($totfra+$totexp),0);
      echo("<td><strong>$pfra</strong></td>");
      echo("<td><strong>$pexp</strong></td>");
      } else {
      echo("<td><strong>0</strong></td>");
      echo("<td><strong>0</strong></td>");
    }
    }
      if (($f+$e)<>0){
      $pf = round(100*$f/($f+$e),0);
      $pe = round(100*$e/($f+$e),0);
      echo("<td><strong>$pf</strong></td>");
      echo("<td><strong>$pe</strong></td>");
      } else {
      echo("<td><strong>0</strong></td>");
      echo("<td><strong>0</strong></td>");
    }
    ?>
    </tr>
    </table>
    </center>
     
    <br>
    <br>
     
    <?php
    //include charts.php to access the InsertChart function
    include "charts.php";?>
     
    <table>
    <tr>
    <td><?php
    //Insertion du graphique des ventes hebdomadaires
    echo InsertChart ( "charts.swf", "charts_library", "sample4.php", 600, 400 );?> </td>
    <td valign =center><?php
    //Insertion du premier commentaire réalisé 
    $com1=$_POST['commentaire1'];
    echo "$com1";?></td>
    </tr>
    </table>
     
    <br>
    <br>
     
    <?php 
    //Insertion du deuxième commentaire réalisé 
    $com2=$_POST['commentaire2'];
    echo "$com2";?>
     
    <br>
    <br>
     
    <center>
    <input type="hidden" name="commentaire1" value="<?=$com1?>">
    <input type="hidden" name="commentaire2" value="<?=$com2?>">
     
    <input type="submit" target="_blank" value="Visualiser la page au format pdf"></input>
    </form>

  12. #12
    Rédacteur

    Avatar de zoom61
    Homme Profil pro
    ...
    Inscrit en
    Janvier 2005
    Messages
    9 429
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Vienne (Limousin)

    Informations professionnelles :
    Activité : ...
    Secteur : Industrie

    Informations forums :
    Inscription : Janvier 2005
    Messages : 9 429
    Points : 58 222
    Points
    58 222
    Billets dans le blog
    11
    Par défaut
    Regarde ce que cela donne avec le code suivant :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    <center>
    <input type="hidden" name="commentaire1" value="<?echo $com1; ?>"></input>
    <input type="hidden" name="commentaire2" value="<?echo $com2; ?>"></input>
     
    <input type="submit" target="_blank" value="Visualiser la page au format pdf"></input>
    </form>

  13. #13
    Membre du Club
    Profil pro
    Inscrit en
    Février 2007
    Messages
    219
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2007
    Messages : 219
    Points : 61
    Points
    61
    Par défaut
    ça change rien

  14. #14
    Rédacteur

    Avatar de zoom61
    Homme Profil pro
    ...
    Inscrit en
    Janvier 2005
    Messages
    9 429
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Vienne (Limousin)

    Informations professionnelles :
    Activité : ...
    Secteur : Industrie

    Informations forums :
    Inscription : Janvier 2005
    Messages : 9 429
    Points : 58 222
    Points
    58 222
    Billets dans le blog
    11
    Par défaut
    Là je ne vois pas, as-tu essayé avec :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <form name="vente_hebdo" target="_blank" method="POST" action="./pdf/pdf_hebdo.php">
    Sinon, je te propose de faire avec un :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <a name="vente_hebdo" target="_blank" href="./pdf/pdf_hebdo.php"><img src="nom_de_fichier">
    nom_de_fichier qui est l'image de ton bouton.

  15. #15
    Membre du Club
    Profil pro
    Inscrit en
    Février 2007
    Messages
    219
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2007
    Messages : 219
    Points : 61
    Points
    61
    Par défaut
    Ok merci je vais essayer

  16. #16
    Membre expérimenté
    Avatar de kaiser59
    Homme Profil pro
    Inscrit en
    Novembre 2005
    Messages
    1 264
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : France

    Informations forums :
    Inscription : Novembre 2005
    Messages : 1 264
    Points : 1 350
    Points
    1 350
    Par défaut
    Salut,

    Si ton navigateur est parametré pour ouvrir dans un nouvel onglet alors tu peux mettre ce que tu veux dans ton target (qui est censé ouvrir une nouvelle page) il ouvrira un nouvel onglet et non une nouvelle fenetre.

    ++

Discussions similaires

  1. Afficher une image d'une DB dans une page web
    Par akaii dans le forum VB.NET
    Réponses: 1
    Dernier message: 09/03/2009, 10h56
  2. Réponses: 1
    Dernier message: 04/04/2008, 12h14
  3. Envoyer une formulaire dans une page dans une Frame
    Par zooffy dans le forum Balisage (X)HTML et validation W3C
    Réponses: 5
    Dernier message: 29/06/2007, 10h13
  4. Réponses: 8
    Dernier message: 10/01/2007, 21h10
  5. [XHTML] [débutant] Ouvrir une page dans une page xhtml
    Par wikers dans le forum Balisage (X)HTML et validation W3C
    Réponses: 2
    Dernier message: 14/02/2006, 16h20

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo