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

Web Perl Discussion :

insertion image


Sujet :

Web Perl

  1. #1
    Candidat au Club
    Inscrit en
    Avril 2010
    Messages
    5
    Détails du profil
    Informations forums :
    Inscription : Avril 2010
    Messages : 5
    Points : 3
    Points
    3
    Par défaut insertion image
    bjr, je suis nouvelle sur ce site et je souhaitrai etre la bienvenue.
    j'ai un problem avec perl, je suis debutante, je travail sur le portail captif chillispot, et je doit personnaliser la page "hotspotlogin.cgi" mais elle est ecrite en perl, je veux inserer une image en utilisant le code:
    <div>
    <div align="center"><img src="images/img.jpg" alt="head" idth="700" height="150"> </div>
    </div>
    mais ça ne marche pas
    aidez moi svp...

  2. #2
    Membre actif
    Homme Profil pro
    Inscrit en
    Juillet 2009
    Messages
    164
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 79
    Localisation : France

    Informations forums :
    Inscription : Juillet 2009
    Messages : 164
    Points : 218
    Points
    218
    Par défaut
    Bonjour,
    Il faudrait savoir si le code la page contient :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    use CGI qw(:standart) ;
    print header;
    ou :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    use CGI;
    $cgi=CGI->new ;
    print $cgi->header;
    ou encore :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    print "Content-type: text/html\n\n" ;
    (ou quelque chose qui y ressemble, à chercher vers le début)
    Vous pouvez dans ce cas remplacer votre code par :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    print <<EndMarker;
    <div>
    <div align="center"><img src="images/img.jpg" alt="head" width="700" height="150"> </div>
    </div>
    EndMarker
    sans espace après le "EndMarker" de la dernière ligne !
    Sinon, il faudrait connaître, en gros la structure du document.
    Cordialement;
    nibroc

    Citation Envoyé par nacera22 Voir le message
    bjr, je suis nouvelle sur ce site et je souhaitrai etre la bienvenue.
    j'ai un problem avec perl, je suis debutante, je travail sur le portail captif chillispot, et je doit personnaliser la page "hotspotlogin.cgi" mais elle est ecrite en perl, je veux inserer une image en utilisant le code:
    <div>
    <div align="center"><img src="images/img.jpg" alt="head" idth="700" height="150"> </div>
    </div>
    mais ça ne marche pas
    aidez moi svp...

  3. #3
    Candidat au Club
    Inscrit en
    Avril 2010
    Messages
    5
    Détails du profil
    Informations forums :
    Inscription : Avril 2010
    Messages : 5
    Points : 3
    Points
    3
    Par défaut help please?
    bjr
    j'ai besoin de votre aide en urgence
    voici le code d'une page ou je doit inserer une image a l'ente de la page,j'ai essayé avec du code php (en rouge)mai ça na pa marché

    aidez moi svp.



    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
    #!/usr/bin/perl
     
    # chilli - ChilliSpot.org. A Wireless LAN Access Point Controller
    # Copyright (C) 2003, 2004 Mondru AB.
    #
    # The contents of this file may be used under the terms of the GNU
    # General Public License Version 2, provided that the above copyright
    # notice and this permission notice is included in all copies or
    # substantial portions of the software.
     
    # Redirects from ChilliSpot daemon:
    #
    # Redirection when not yet or already authenticated
    #   notyet:  ChilliSpot daemon redirects to login page.
    #   already: ChilliSpot daemon redirects to success status page.
    #
    # Response to login:
    #   already: Attempt to login when already logged in.
    #   failed:  Login failed
    #   success: Login succeded
    #
    # logoff:  Response to a logout
     
     
    # Shared secret used to encrypt challenge with. Prevents dictionary attacks.
    # You should change this to your own shared secret.
    $uamsecret = "xxxx";
    #uamsecret = "chillisecret";
    # Uncomment the following line if you want to use ordinary user-password
    # for radius authentication. Must be used together with $uamsecret.
    $userpassword=1;
     
    # Our own path
    $loginpath = "/cgi-bin/hotspotlogin.cgi";
     
     
    use Digest::MD5  qw(md5 md5_hex md5_base64);
     
    # Make sure that the form parameters are clean
    $OK_CHARS='-a-zA-Z0-9_.@&=%!';
    $_ = $input = <STDIN>;
    s/[^$OK_CHARS]/_/go;
    $input = $_;
     
    # Make sure that the get query parameters are clean
    $OK_CHARS='-a-zA-Z0-9_.@&=%!';
    $_ = $query=$ENV{QUERY_STRING};
    s/[^$OK_CHARS]/_/go;
    $query = $_;
     
     
    # If she did not use https tell her that it was wrong.
    if (!($ENV{HTTPS} =~ /^on$/)) {
        print "Content-type: text/html\n\n
    <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
    <html>
    <head>
      <title>ChilliSpot Login Failed</title>
      <meta http-equiv=\"Cache-control\" content=\"no-cache\">
      <meta http-equiv=\"Pragma\" content=\"no-cache\">
    </head>
     
    <body bgColor = '#c8c8fa'>
      <h1 style=\"text-align: center;\">ChilliSpot Login Failed</h1>

    print"/home/benbernou/Desktop/nacera/img.jpg";


    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
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
      <center>
        Login must use encrypted connection.
      </center>
    </body>
    <!--
    <?xml version=\"1.0\" encoding=\"UTF-8\"?>
    <WISPAccessGatewayParam 
      xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
      xsi:noNamespaceSchemaLocation=\"http://www.acmewisp.com/WISPAccessGatewayParam.xsd\">
    <AuthenticationReply>
    <MessageType>120</MessageType>
    <ResponseCode>102</ResponseCode>
    <ReplyMessage>Login must use encrypted connection</ReplyMessage>
    </AuthenticationReply> 
    </WISPAccessGatewayParam>
    -->
    </html>
    ";
        exit(0);
    }
     
     
    #Read form parameters which we care about
    @array = split('&',$input);
    foreach $var ( @array )
    {
        @array2 = split('=',$var);
        if ($array2[0] =~ /^UserName$/) { $username = $array2[1]; }
        if ($array2[0] =~ /^Password$/) { $password = $array2[1]; }
        if ($array2[0] =~ /^challenge$/) { $challenge = $array2[1]; }
        if ($array2[0] =~ /^button$/) { $button = $array2[1]; }
        if ($array2[0] =~ /^logout$/) { $logout = $array2[1]; }
        if ($array2[0] =~ /^prelogin$/) { $prelogin = $array2[1]; }
        if ($array2[0] =~ /^res$/) { $res = $array2[1]; }
        if ($array2[0] =~ /^uamip$/) { $uamip = $array2[1]; }
        if ($array2[0] =~ /^uamport$/) { $uamport = $array2[1]; }
        if ($array2[0] =~ /^userurl$/)   { $userurl = $array2[1]; }
        if ($array2[0] =~ /^timeleft$/)  { $timeleft = $array2[1]; }
        if ($array2[0] =~ /^redirurl$/)  { $redirurl = $array2[1]; }
    }
     
    #Read query parameters which we care about
    @array = split('&',$query);
    foreach $var ( @array )
    {
        @array2 = split('=',$var);
        if ($array2[0] =~ /^res$/)       { $res = $array2[1]; }
        if ($array2[0] =~ /^challenge$/) { $challenge = $array2[1]; }
        if ($array2[0] =~ /^uamip$/)     { $uamip = $array2[1]; }
        if ($array2[0] =~ /^uamport$/)   { $uamport = $array2[1]; }
        if ($array2[0] =~ /^reply$/)     { $reply = $array2[1]; }
        if ($array2[0] =~ /^userurl$/)   { $userurl = $array2[1]; }
        if ($array2[0] =~ /^timeleft$/)  { $timeleft = $array2[1]; }
        if ($array2[0] =~ /^redirurl$/)  { $redirurl = $array2[1]; }
    }
     
     
    $reply =~ s/\+/ /g;
    $reply =~s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/seg;
     
    $userurldecode = $userurl;
    $userurldecode =~ s/\+/ /g;
    $userurldecode =~s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/seg;
     
    $redirurldecode = $redirurl;
    $redirurldecode =~ s/\+/ /g;
    $redirurldecode =~s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/seg;
     
    $password =~ s/\+/ /g;
    $password =~s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/seg;
     
    # If attempt to login
    if ($button =~ /^Login$/) {
        $hexchal  = pack "H32", $challenge;
        if (defined $uamsecret) {
    	$newchal  = md5($hexchal, $uamsecret);
        }
        else {
    	$newchal  = $hexchal;
        }
        $response = md5_hex("\0", $password, $newchal);
        $pappassword = unpack "H32", ($password ^ $newchal);
    #sleep 5;
    print "Content-type: text/html\n\n";
    print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
    <html>
    <head>
      <title>ChilliSpot Login</title>
      <meta http-equiv=\"Cache-control\" content=\"no-cache\">
      <meta http-equiv=\"Pragma\" content=\"no-cache\">";
        if ((defined $uamsecret) && defined($userpassword)) {
    	print "  <meta http-equiv=\"refresh\" content=\"0;url=http://$uamip:$uamport/logon?username=$username&password=$pappassword\">";
        } else {
    	print "  <meta http-equiv=\"refresh\" content=\"0;url=http://$uamip:$uamport/logon?username=$username&response=$response&userurl=$userurl\">";
        }
    print "</head>
     
     
     
    <body bgColor = '#c8c8fa'>";
      print "<h1 style=\"text-align: center;\">Logging in to ChilliSpot</h1>";
      print "
      <center>
        Please wait......
      </center>
    </body>
    <!--
    <?xml version=\"1.0\" encoding=\"UTF-8\"?>
    <WISPAccessGatewayParam 
      xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
      xsi:noNamespaceSchemaLocation=\"http://www.acmewisp.com/WISPAccessGatewayParam.xsd\">
    <AuthenticationReply>
    <MessageType>120</MessageType>
    <ResponseCode>201</ResponseCode>
    ";
        if ((defined $uamsecret) && defined($userpassword)) {
    	print "<LoginResultsURL>http://$uamip:$uamport/logon?username=$username&password=$pappassword</LoginResultsURL>";
        } else {
    	print "<LoginResultsURL>http://$uamip:$uamport/logon?username=$username&response=$response&userurl=$userurl</LoginResultsURL>";
        }
    print "</AuthenticationReply> 
    </WISPAccessGatewayParam>
    -->
    </html>
    ";
        exit(0);
    }
     
     
    # Default: It was not a form request
    $result = 2;
     
    # If login successful
    if ($res =~ /^success$/) { 
        $result = 1;
    }
     
    # If login failed 
    if ($res =~ /^failed$/) { 
        $result = 2;
    }
     
    # If logout successful
    if ($res =~ /^logoff$/) { 
        $result = 3;
    }
     
    # If tried to login while already logged in
    if ($res =~ /^already$/) { 
        $result = 4;
    }
     
    # If not logged in yet
    if ($res =~ /^notyet$/) { 
        $result = 5;
    }
     
    # If login from smart client
    if ($res =~ /^smartclient$/) { 
        $result = 6;
    }
     
    # If requested a logging in pop up window
    if ($res =~ /^popup1$/) { 
        $result = 11;
    }
     
    # If requested a success pop up window
    if ($res =~ /^popup2$/) { 
        $result = 12;
    }
     
    # If requested a logout pop up window
    if ($res =~ /^popup3$/) { 
        $result = 13;
    }
     
     
    # Otherwise it was not a form request
    # Send out an error message
     
    #Generate the output
    print "Content-type: text/html\n\n
    <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
    <html>
    <head>
      <title>ChilliSpot Login</title>
      <meta http-equiv=\"Cache-control\" content=\"no-cache\">
      <meta http-equiv=\"Pragma\" content=\"no-cache\">
      <SCRIPT LANGUAGE=\"JavaScript\">
        var blur = 0;
        var starttime = new Date();
        var startclock = starttime.getTime();
        var mytimeleft = 0;
     
        function doTime() {
          window.setTimeout( \"doTime()\", 1000 );
          t = new Date();
          time = Math.round((t.getTime() - starttime.getTime())/1000);
          if (mytimeleft) {
            time = mytimeleft - time;
            if (time <= 0) {
              window.location = \"$loginpath?res=popup3&uamip=$uamip&uamport=$uamport\";
            }
          }
          if (time < 0) time = 0;
          hours = (time - (time % 3600)) / 3600;
          time = time - (hours * 3600);
          mins = (time - (time % 60)) / 60;
          secs = time - (mins * 60);
          if (hours < 10) hours = \"0\" + hours;
          if (mins < 10) mins = \"0\" + mins;
          if (secs < 10) secs = \"0\" + secs;
          title = \"Online time: \" + hours + \":\" + mins + \":\" + secs;
          if (mytimeleft) {
            title = \"Remaining time: \" + hours + \":\" + mins + \":\" + secs;
          }
          if(document.all || document.getElementById){
             document.title = title;
          }
          else {   
            self.status = title;
          }
        }
     
        function popUp(URL) {
          if (self.name != \"chillispot_popup\") {
            chillispot_popup = window.open(URL, 'chillispot_popup', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=375');
          }
        }
     
        function doOnLoad(result, URL, userurl, redirurl, timeleft) {
          if (timeleft) {
            mytimeleft = timeleft;
          }
          if ((result == 1) && (self.name == \"chillispot_popup\")) {
            doTime();
          }
          if ((result == 1) && (self.name != \"chillispot_popup\")) {
            chillispot_popup = window.open(URL, 'chillispot_popup', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=375');
          }
          if ((result == 2) || result == 5) {
            document.form1.UserName.focus()
          }
          if ((result == 2) && (self.name != \"chillispot_popup\")) {
            chillispot_popup = window.open('', 'chillispot_popup', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=200');
            chillispot_popup.close();
          }
          if ((result == 12) && (self.name == \"chillispot_popup\")) {
            doTime();
            if (redirurl) {
              opener.location = redirurl;
            }
            else if (opener.home) {
              opener.home();
            }
            else {
              opener.location = \"about:home\";
            }
            self.focus();
            blur = 0;
          }
          if ((result == 13) && (self.name == \"chillispot_popup\")) {
            self.focus();
            blur = 1;
          }
        }
     
        function doOnBlur(result) {
          if ((result == 12) && (self.name == \"chillispot_popup\")) {
            if (blur == 0) {
              blur = 1;
              self.focus();
            }
          }
        }
        function doOnUnLoad(result) {
          if ((result==12) && (self.name=='chillispot_popup')) {
            window.close();
            document.location.href=('http://$uamip:$uamport/logoff');
          }
        }
      </script>
    </head>
     
    entete           
     
     
     
     
     
    <body onLoad=\"javascript:doOnLoad($result, '$loginpath?res=popup2&uamip=$uamip&uamport=$uamport&userurl=$userurl&redirurl=$redirurl&timeleft=$timeleft','$userurldecode', '$redirurldecode', '$timeleft')\" onBlur = \"javascript:doOnBlur($result)\" onUnLoad=\"doOnUnLoad($result)\" bgColor = '#c0d8f4'>";
     
     
     
    #      if (!window.opener) {
    #        document.bgColor = '#c8c8fa';
    #      }
     
    #print "THE INPUT: $input";
    #foreach $key (sort (keys %ENV)) {
    #	print $key, ' = ', $ENV{$key}, "<br>\n";
    #}
     
    if ($result == 2) {
        print "
      <h1 style=\"text-align: center;\">ChilliSpot Login Failed</h1>";
        if ($reply) {
    	print "<center> $reply </BR></BR></center>";
        }
    }
     
    if ($result == 5) {
        print "
      <h1 style=\"text-align: center;\">ChilliSpot Login</h1>";
    }
     
    if ($result == 2 || $result == 5) {
      print "
      <form name=\"form1\" method=\"post\" action=\"$loginpath\">
      <INPUT TYPE=\"hidden\" NAME=\"challenge\" VALUE=\"$challenge\">
      <INPUT TYPE=\"hidden\" NAME=\"uamip\" VALUE=\"$uamip\">
      <INPUT TYPE=\"hidden\" NAME=\"uamport\" VALUE=\"$uamport\">
      <INPUT TYPE=\"hidden\" NAME=\"userurl\" VALUE=\"$userurl\">
     
     
     
     
     
      <center>
      <table border=\"0\" cellpadding=\"5\" cellspacing=\"0\" style=\"width: 217px;\">
        <tbody>
          <tr>
            <td align=\"right\">Username:</td>
            <td><input STYLE=\"font-family: Arial\" type=\"text\" name=\"UserName\" size=\"20\" maxlength=\"128\"></td>
          </tr>
          <tr>
            <td align=\"right\">Password:</td>
            <td><input STYLE=\"font-family: Arial\" type=\"password\" name=\"Password\" size=\"20\" maxlength=\"128\"></td>
          </tr>
          <tr>
            <td align=\"center\" colspan=\"2\" height=\"23\"><input type=\"submit\" name=\"button\" value=\"Login\" onClick=\"javascript:popUp('$loginpath?res=popup1&uamip=$uamip&uamport=$uamport')\"></td> 
          </tr>
        </tbody>
     Validation
      </table>
      </center>
      </form>
    </body>
    pied
    </html>";
    }
     
    if ($result == 1) {
      print "
      <h1 style=\"text-align: center;\">Logged in to ChilliSpot</h1>";
     
      if ($reply) { 
          print "<center> $reply </BR></BR></center>";
      }
     
      print "
      <center>
        <a href=\"http://$uamip:$uamport/logoff\">Logout</a><br><br>
        Vous devez cliquer sur le Logout pour vous d&eacute;connecter<br>
        You must click on Logout link to unconnect you
      </center>
    </body>
    </html>";
    }
     
    if (($result == 4) || ($result == 12)) {
      print "
      <h1 style=\"text-align: center;\">Logged in to ChilliSpot</h1>
      <center>
        <a href=\"javascript:doOnUnLoad(12);\">Logout</a><br><br>
        La fermeture de cette fen&ecirc;tre cl&ocirc;t la connexion avec votre 
        compte<br>
        Closing this window end connection with your account
      </center>
    </body>
    </html>";
    }
     
     
    if ($result == 11) {
      print "<h1 style=\"text-align: center;\">Logging in to ChilliSpot</h1>";
      print "
      <center>
        Please wait......
      </center>
    </body>
    </html>";
    }
     
     
    if (($result == 3) || ($result == 13)) {
        print "
      <h1 style=\"text-align: center;\">Logged out from ChilliSpot</h1>
      <center>
        <a href=\"http://$uamip:$uamport/prelogin\">Login</a>
      </center>
    </body>
    </html>";
    }
     
     
    exit(0);

  4. #4
    Responsable Perl et Outils

    Avatar de djibril
    Homme Profil pro
    Inscrit en
    Avril 2004
    Messages
    19 820
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Avril 2004
    Messages : 19 820
    Points : 499 184
    Points
    499 184
    Par défaut
    Arrêtez de poster des messages n'importe où ? et de plus, il est inutile de faire des demandes par messages privés. Les soucis se règles sur le forum.
    Pour une meilleur lisibilité de votre code, pensez à l'entourer de balise code la prochaine fois.

  5. #5
    Responsable Perl et Outils

    Avatar de djibril
    Homme Profil pro
    Inscrit en
    Avril 2004
    Messages
    19 820
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Avril 2004
    Messages : 19 820
    Points : 499 184
    Points
    499 184
    Par défaut
    votre problème n'est pas une question Perl mais html. pour afficher une image en HTML, on utilise la balise img .

    Voici un exemple de code à insérer.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    print "<img src='/home/benbernou/Desktop/nacera/img.jpg' >";
    Lorsque vous avez un souci, veuillez préciser le message d'erreur ou toute autre indication nous permettant de vous aider, nous ne pouvons pas deviner.

    Je vous recommande de lire ces règles.

    Merci

  6. #6
    Candidat au Club
    Inscrit en
    Avril 2010
    Messages
    5
    Détails du profil
    Informations forums :
    Inscription : Avril 2010
    Messages : 5
    Points : 3
    Points
    3
    Par défaut
    je suis désolée..
    merci pr votre reponse, j'ai éssayée le code que vous m'avez donné mais a la place d'une image il est apparait une petite icon?

  7. #7
    Responsable Perl et Outils

    Avatar de djibril
    Homme Profil pro
    Inscrit en
    Avril 2004
    Messages
    19 820
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Avril 2004
    Messages : 19 820
    Points : 499 184
    Points
    499 184
    Par défaut
    Pouvez vous faire une capture d'écran et nous montrer ?
    Le fichier /home/benbernou/Desktop/nacera/img.jpg existe il vraiment ?
    Qu'est ce qu'il y a dans le fichier log ?
    Quelle est la racine de votre site web ? Est-ce /var/www ?
    Vous travaillez sous quel OS ?

  8. #8
    Membre actif
    Homme Profil pro
    Inscrit en
    Juillet 2009
    Messages
    164
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 79
    Localisation : France

    Informations forums :
    Inscription : Juillet 2009
    Messages : 164
    Points : 218
    Points
    218
    Par défaut
    Oui, mais apparemment, la balise qui devrait afficher l'image se trouverait dans un
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    if (!($ENV{HTTPS} =~ /^on$/)) {
    }
    Ce qui est bien du Perl, autant écrire :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    if ($ENV{HTTPS} !~ /^on$/) {
    }
    voire
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    if ($ENV{HTTPS} ne "on") {
    }
    À mon avis, il faudrait mettre :
    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
    # If she did not use https tell her that it was wrong.
    if (!($ENV{HTTPS} =~ /^on$/)) {
    print "Content-type: text/html\n\n" ;
    print <<EndMarker;
    <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
    <html>
    <head>
      <title>ChilliSpot Login Failed</title>
      <meta http-equiv=\"Cache-control\" content=\"no-cache\">
      <meta http-equiv=\"Pragma\" content=\"no-cache\">
    </head>
    <body bgColor = '#c8c8fa'>
      <h1 style=\"text-align: center;\">ChilliSpot Login Failed</h1>
    <img src="/home/benbernou/Desktop/nacera/img.jpg">
      <center>
        Login must use encrypted connection.
      </center>
    </body>
    EndMarker
    }
    L'endroit où placer ce code est évident.
    Cordialement,
    nibroc
    Citation Envoyé par djibril Voir le message
    votre problème n'est pas une question Perl mais html. pour afficher une image en HTML, on utilise la balise img .

    Voici un exemple de code à insérer.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    print "<img src='/home/benbernou/Desktop/nacera/img.jpg' >";
    Lorsque vous avez un souci, veuillez préciser le message d'erreur ou toute autre indication nous permettant de vous aider, nous ne pouvons pas deviner.

    Je vous recommande de lire ces règles.

    Merci

  9. #9
    Membre actif
    Homme Profil pro
    Inscrit en
    Juillet 2009
    Messages
    164
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 79
    Localisation : France

    Informations forums :
    Inscription : Juillet 2009
    Messages : 164
    Points : 218
    Points
    218
    Par défaut
    Bonjour,
    Juste après la première ligne :
    rajouter la ligne suivante :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    use CGI::Carp qw(warningsToBrowser fatalsToBrowser) ;
    Cela permet d'avoir une idée sur l'erreur commise.
    nibroc
    Citation Envoyé par nacera22 Voir le message
    bjr
    j'ai besoin de votre aide en urgence
    voici le code d'une page ou je doit inserer une image a l'ente de la page,j'ai essayé avec du code php (en rouge)mai ça na pa marché

    aidez moi svp.

  10. #10
    Candidat au Club
    Inscrit en
    Avril 2010
    Messages
    5
    Détails du profil
    Informations forums :
    Inscription : Avril 2010
    Messages : 5
    Points : 3
    Points
    3
    Par défaut merci a vous
    merci beaucoup,j'ai réglé le pb d'image, il falait la mettre dans le repertoire : /var/www et non pas dans /usr/lib/cgi-bin/
    merci pr votre aide.merci beaucoup

  11. #11
    Responsable Perl et Outils

    Avatar de djibril
    Homme Profil pro
    Inscrit en
    Avril 2004
    Messages
    19 820
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Avril 2004
    Messages : 19 820
    Points : 499 184
    Points
    499 184
    Par défaut
    N'oubliez pas de mettre votre post en résolu.

    Merci

  12. #12
    Candidat au Club
    Inscrit en
    Avril 2010
    Messages
    5
    Détails du profil
    Informations forums :
    Inscription : Avril 2010
    Messages : 5
    Points : 3
    Points
    3
    Par défaut pb resolu
    svp,veuillez just m'indiquer comment mettre mon post en résolu..

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Insertion image
    Par pitit777 dans le forum OpenGL
    Réponses: 2
    Dernier message: 09/02/2006, 12h47
  2. [FLASH MX] Problème PHP/Flash insertion image
    Par eyovas dans le forum Flash
    Réponses: 4
    Dernier message: 25/01/2006, 09h09
  3. probleme insertion images
    Par kojima dans le forum Balisage (X)HTML et validation W3C
    Réponses: 2
    Dernier message: 29/12/2005, 22h30
  4. [Excel][POI] insertion image
    Par noOneIsInnocent dans le forum Documents
    Réponses: 7
    Dernier message: 29/09/2005, 17h04
  5. [javascript] problème insertion image
    Par Pwill dans le forum Général JavaScript
    Réponses: 6
    Dernier message: 18/05/2005, 16h12

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