grazie per la diritta ma tutt'ora non riesco ad ottenere ciò che voglio. l'immagine nella pagina appare con una x.
Ho creato un file di nome convertitorecoloriimg.php con il seguente codice:
Codice PHP:
<?php
$image_height = 30;
$image_width = 30;
$image = imagecreate($image_width, $image_height);
$back_color = imagecolorallocate($image, 200, 200, 200);
header("Content-type: " . image_type_to_mime_type(IMAGETYPE_JPEG));
imagejpeg($image);
imagedestroy($image);
?>
Reperibile da qui: http://www.lmweb.it/utily/convertitorecoloriimg.php
E la pagina web che richiama l'immagine con il seguente codice:
Codice PHP:
<!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" dir="ltr">
<head>
<link rel="alternate" type="application/rss+xml" title="LMWEB.it: Il Portale Tecnologico" href="../news.xml" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>LMWEB.it - Convertitore colori</title>
<link href="../styles/style3.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.style1 {
text-align: center;
font-size: xx-large;
}
.style2 {
border-width: 0px;
}
.style3 {
background-color: #FF0000;
}
.style4 {
background-color: #008000;
}
.style5 {
background-color: #0000FF;
}
</style>
</head>
<body style="background-color: #FFFFFF">
<div id="container" style="width: 790px">
<div id="masthead" style="width: 790px">
[img]../images/logo.jpg[/img]
<p align="right">
<a href="../news.xml">
[img]../images/RSS.JPG[/img]</a></p>
</div>
<div id="page_content">
<div id="sidebar">
<ul>
[*][url="../index.htm"]Home[/url]
[*][url="http://forum.lmweb.it"]Forum[/url]
[*][url="../Elettronica/elettronica.htm"]Elettronica[/url]
[*][url="../Elettrotecnica/elettrotecnica.htm"]Elettrotecnica[/url]
[*][url="../informatica/informatica.htm"]Informatica[/url]
[*][url="../livemessenger/livemessenger.htm"]Live Messenger[/url]
[*][url="utily.htm"]Utily & divertimento[/url]
[*]<P align="center"><script type="text/javascript"><!--
google_ad_client = "pub-6613693222943033";
google_ad_width = 120;
google_ad_height = 240;
google_ad_format = "120x240_as";
google_ad_type = "text_image";
//2007-10-07: Menù sinistra
google_ad_channel = "6971627212";
google_color_border = "336699";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_text = "000000";
google_color_url = "008000";
google_ui_features = "rc:10";
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></P>
[/list]
</div>
<div id="content" style="width: 600px">
<h1 class="style1">Convertitore colori</h1>
<table style="width: 100%">
<tbody>
<tr>
<td style="width: 133px">Colore:</td>
<td colspan="2">[img]convertitorecoloriimg.php[/img]</a>
</td>
</tr>
<tr>
<td style="width: 133px">Valore esadecimale:</td>
<td colspan="2"><?php
$w = (float) $_REQUEST["a"];
$e = (float) $_REQUEST["b"];
$r = (float) $_REQUEST["c"];
$red = dechex( $w );
$green = dechex( $e );
$blue = dechex( $r );
if ($w < 255 & $e < 255 & $r < 255) {echo "#",str_pad($red, 2, "0", STR_PAD_LEFT),str_pad($green, 2, "0", STR_PAD_LEFT),str_pad($blue, 2, "0", STR_PAD_LEFT);
}
else {echo "I valori immessi di rosso, verde e blu devono essere compresi fra 0 e 255.";
}
?>
</td>
</tr>
<tr>
<td style="width: 133px"></td>
<td style="width: 233px"></td>
<td></td>
</tr>
<tr>
<td style="width: 133px">Valore RGB:</td>
<td style="width: 233px" class="style3">Rosso</td>
<td class="style3"><?php echo $_REQUEST["a"]; ?></td>
</tr>
<tr>
<td style="width: 133px"></td>
<td style="width: 233px" class="style4">Verde</td>
<td class="style4"><?php echo $_REQUEST["b"]; ?></td>
</tr>
<tr>
<td style="width: 133px"></td>
<td style="width: 233px" class="style5">Blu</td>
<td class="style5"><?php echo $_REQUEST["c"]; ?></td>
</tr>
</tbody>
</table>
</div>
<form></form>
</div>
</div>
<div></div>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-1624260-2";
urchinTracker();
</script>
</body>
</html>
Ma non riesco a far comparire questa immagine come faccio???