<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[script per generazioni immagini probblemi di funzionamento]]></title><description><![CDATA[<p dir="auto">Ciao<br />
ho trovato questo script di esempio per generare immagini attraverso del codice php.</p>
<p dir="auto">Pultroppo non sono molto brava con il codice......... <img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/android/1f622.png?v=3abbd2034aa" class="not-responsive emoji emoji-android emoji--cry" style="height:1.4em;width:auto;vertical-align:middle" title=":cry:" alt="😢" /> e ho riscontrato qualche difficoltà.</p>
<p dir="auto">Il testo originale era questo:</p>
<pre><code>&lt;?php
/* form.php
Click Captcha Ver.1
Created on: 4/17/2007 by Ron Hickey
http://6tx.net/sc */
//buffer
ob_start('ob_gzhandler');
session_start();

// if submit
if (($_POST[x])&amp;&amp;(substr($_SESSION[igif], 17) === $_SESSION['afloat'])){

// posted
$x = $_POST[x];

// you can remove 4 lines below they are for demo
$fname = strip_tags($_POST[fname]);
$lname = strip_tags($_POST[lname]);
$fname = stripslashes(substr($fname, 0, 12));
$lname = stripslashes(substr($lname, 0, 12));
// you can remove 4 lines above they are for demo

// decode, strip string and round numbers
$a = base64_decode($_SESSION['afloat']);
$b = 0 + $a;
$a = explode(" ", $a);
$a = $a[3];
$bb = round($b);
$aa = round($a);

// x coords
$gc = explode(" ", '0 19 40 60 82 104 79 100 121 142 163 185');

// check if correct number has been clicked
$ac = $aa + 6;
if ($bb &lt;= $aa){ $ac = $bb + 1; }

//demo wrong number clicked error message below
$mess = "ERROR: Sorry " . stripslashes($fname . "_" . $lname) . " wrong number clicked";
// if correct number clicked success
if (($x &gt;= $gc[$ac-1]) &amp;&amp; ($x &lt;= $gc[$ac])){
// submit your form

//demo SUCCESS message below
$mess = "SUCCESS: Yes " . stripslashes($fname . "_" . $lname) . " correct number clicked";
}

//demo alert message below
?&gt;
&lt;script&gt;
alert("&lt;?=$mess;?&gt;");
window.location = window.location;
&lt;/script&gt;
&lt;?
session_unset();
session_destroy();
ob_end_flush();
exit;
}
// afloat = base64_encoded random string
$afloat = base64_encode(" " . $num1 = rand(0,3) . "." . $num2 = rand(100,999) . "
 Float " . $num3 = rand(1,4) . "." . $num4 = rand(100,999) . "  ");

// rectangle x coord

$aler = "&gt; 78";
if(round($num1 . "." . $num2) &lt;= round($num3 . "." . $num4)) {$aler = "&lt; 105";}

// create random image
$_SESSION[igif] = "create_gif.php?a=" . $afloat . "";
$_SESSION['afloat'] = $afloat;

?&gt;
&lt;html&gt;
&lt;head&gt;
&lt;style type="text/css"&gt;
/* click image */
.cd {
width: 185px;
height: 15px;
background-image: url(&lt;?=$_SESSION[igif];?&gt;);
background-repeat: no-repeat;
position: relative;
left:&lt;?=rand(-100,100);?&gt;px;
bottom:&lt;?=rand(55,80);?&gt;px;
z-index: 2;
}
&lt;/style&gt;
&lt;script language="JavaScript"&gt;
// submit form func
function submitform() {

// You can remove 6 lines below they are for demo
if (document.xcoords.fname.value == "") {
alert("Please Enter First Name.");
return false;}
if (document.xcoords.lname.value == "") {
alert("Please Enter Last Name.");
return false; }
// You can remove 6 lines above they are for demo

// if box coord submit else rectangle coord alert
// Do not edit javascript below this line. you can edit the alert message

if (document.xcoords.x.value &lt;?=$aler;?&gt;) {
document.xcoords.submit();

} else {
alert("Click number in square identicale to number in rectangle to submit.");
}
}
// image x value
function xcoord(event) {
image = event.offsetX?(event.offsetX):event.pageX-document.getElementById("coord").offsetLeft;
document.xcoords.x.value = image;
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body bgcolor="#FFFFFF"&gt;
&lt;div align=center&gt;
&lt;table border="0" cellspacing="5" cellpadding="5"&gt;
&lt;tr&gt;
&lt;td align="center" style="font: 12px Arial; font-weight: normal; color: black; border-color: maroon; border-style: solid; border-width: 1px; background: #FFFFFF; height: 20px; width: 185px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; position: relative; font-weight: normal;"&gt;Click Captcha Demo &lt;br&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;table border="0"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;form name="xcoords" action="&lt;?=$_SERVER['PHP_SELF']; ?&gt;" method="post"&gt;
&lt;table border="0" bgcolor="#FFFFFF" cellpadding="5" cellspacing="5" width="400" style="border: 1px solid maroon"&gt;
&lt;tr&gt;
&lt;td align="right"&gt;
&lt;table border="0" cellpadding="5" cellspacing="5" width="300" bgcolor="#FFFFFF"&gt;
&lt;tr&gt;
&lt;td align="right" valign="middle" style="width: 70px; font: 12px Arial, Helvetica, sans-serif; color: #000000; background: #FFFFFF; border-left-width: 1px; border-left-style: solid; border-left-color: maroon; border-bottom-style: solid; border-bottom-color: maroon; border-bottom-width: 1px; padding-top: 2px; padding-right: 5px; padding-bottom: 1px; padding-left: 2px;"&gt;First Name:&lt;/td&gt;
&lt;td align="left" valign="top"&gt;&lt;input type="text" name="fname" value="First" style="font: 12px Arial, Helvetica, sans-serif; color: maroon; border-color: maroon; border-style: solid; border-width: 1px; background: #FFFF99; height: 20px; width: 60px; position: relative; font-weight: normal; letter-spacing: 1px; text-align: left; padding-left: 3px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="right" valign="middle" style="width: 70px; font: 12px Arial, Helvetica, sans-serif; color: #000000; background: #FFFFFF; border-left-width: 1px; border-left-style: solid; border-left-color: maroon; border-bottom-style: solid; border-bottom-color: maroon; border-bottom-width: 1px; padding-top: 2px; padding-right: 5px; padding-bottom: 1px; padding-left: 2px;"&gt;Last Name:&lt;/td&gt;
&lt;td align="left" valign="top"&gt;&lt;input type="text" name="lname" value="Last" style="font: 12px Arial, Helvetica, sans-serif; color: maroon; border-color: maroon; border-style: solid; border-width: 1px; background: #FFFF99; height: 20px; width: 60px; position: relative; font-weight: normal; letter-spacing: 1px; text-align: left; padding-left: 3px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/td&gt;
&lt;/tr&gt;&lt;!-- include hidden form input: x &gt;&gt;&gt;&gt;&gt;--&gt;&lt;input type="hidden" name="x" /&gt;&lt;tr&gt;
&lt;td align="center"&gt;&lt;table border="0"&gt;&lt;tr&gt;&lt;td style="font: 11px Arial; color: maroon; border-color: maroon; border-style: solid; border-width: 1px; background: #F8F8FF; height: 30px; width: 189px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; position: relative; font-weight: normal;"&gt;Submit: click number in image square identicale to number in image rectangle&lt;/td&gt;
&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&lt;p&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;&lt;/form&gt;&lt;/td&gt;&lt;tr&gt;
&lt;!-- This line &gt;&gt;&gt;&gt; &lt;div id="coord" onclick="submitform(xcoord(event))" class="cd"&gt;&lt;/div&gt; &gt;&gt;&gt; Must be outside of form tags &lt;form&gt;&lt;/form&gt; to work in FF, NS and Opera &gt;&gt;&gt;&gt; --&gt;
&lt;td width="390" align="center" valign="top"&gt;&amp;nbsp;&lt;p&gt;&lt;div id="coord" onclick="submitform(xcoord(event))" class="cd"&gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;
&lt;? ob_end_flush(); ?&gt;
</code></pre>
<p dir="auto">e la pagina per generare immagini che porta questo codice:</p>
<pre><code>&lt;?php
/* create_gif.php
Click Captcha Ver.1
Created on: 4/17/2007 by Ron Hickey
http://6tx.net/sc */
//buffer
ob_start('ob_gzhandler');
session_start();
//DEC 67
//get a and decode
//
$a = $_GET['a'];
if ($a == $_SESSION['afloat']){
$a = base64_decode($a);
$im = imagecreatetruecolor (185, 15);
//DEC 79
//random numbers
//
$myn = array($ooon = rand(81,99), $tooo = rand(61,$ooon-1), $trif = rand(41,$tooo-1),
$foey = rand(21,$trif-1), $flit = rand(11,$foey-1));
$rn = array_rand($myn, 5);
$mynum = " " . $myn[$rn[0]] . " " . $myn[$rn[1]] . " " . $myn[$rn[2]] . " " . $myn[$rn[3]] . " " . $myn[$rn[4]] . "";

//DEC 68
//get first numbers from string b.bbb"
//
$b = 0 + $a;
//DEC 69
//get last numbers from string "a.aaa
//
$a = explode(" ", $a);
$a = $a[3];
//DEC 66
//round &lt; a.aaa&gt; to nearest number = round a
//
$aa = round($a);
//DEC 89
//round &lt; b.bbb &gt; to nearest number = round b
//
$bb = round($b);
//DEC 82
//string, random click number and line coord
//
$na = 79;
$nb = 185;
$nc = 82;
$nd = 182;
$ims = -1;
$ab = explode(" ", $mynum);
$mystring = "Click $ab[$aa]  $mynum";
//DEC 79
//if bb &lt;= aa reverse string and line coord. click number aa = bb + 1
//
if ($bb &lt;= $aa){
$aa = $bb + 1;
$mystring = "" . $mynum . " Click $ab[$aa] ";
$na = 0;
$nb = 106;
$nc = 4;
$nd = 104;
$ims = -9;
}
//DEC 78
//random image color
//
$change = rand(1,9);
$lime = imagecolorallocate($im,0,255,0);
$yellow = imagecolorallocate($im,255,255,0);
$white = imagecolorallocate($im,255,255,255);
$lgray = imagecolorallocate($im,206,206,206);
$gray = imagecolorallocate($im,115,115,115);
$black = imagecolorallocate($im,0,0,0);
$green = imagecolorallocate($im,1,107,0);
$grc = " $lime $yellow $white $lgray $yellow $white $gray $black $green";
$rc = explode(" ", $grc);
$bgc = $rc[$change];
//DEC 72
//line &amp; number colors
//
$bc = imagecolorallocate ($im, 0, 0, 0);
$rd = imagecolorallocate ($im, 255, 0, 0);
$wh = imagecolorallocate ($im, 255, 255, 255);
//DEC 73
//if color = this change line &amp; number color
//
if (($change &gt; 3) &amp;&amp; ($change &lt; 7)) { $bc = $rd;}
elseif ($change &gt; 6) { $bc = $wh;}
//DEC 67
//fill image color
//
imagefilledrectangle ($im, 1, 1, 184, 15, $bgc);
imagerectangle ($im, 0, 0, 184, 14, $bc);
//DEC 75
//vertical lines
//
for($i=$na;$i&lt;=$nb;$i+=21)
imageline($im,$i,0,$i,15,$bc);

//DEC 69
//image string
//
imagestring ($im, 3, $ims, 1, " $mystring", $bc);
//DEC 89
//header content
//
header("Content-Type: image/gif");
//DEC 48
//send image
//
imagegif($im);
//DEC 55
//destroy image
//
imagedestroy($im);
}
//flush
ob_end_flush();
?&gt;
</code></pre>
<p dir="auto">Adesso io stò cercando di adattare il codice alla mia pagina web che vedete qui:<br />
<a href="http://www.designgrouparchitetti.it/contattami-1.php" rel="nofollow ugc">http://www.designgrouparchitetti.it/contattami-1.php</a></p>
<p dir="auto">Ma come potete vedere voi stessi la pagina non funziona come dovrebbe, non viene carricata nessuna immagine.  <img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/android/274c.png?v=3abbd2034aa" class="not-responsive emoji emoji-android emoji--x" style="height:1.4em;width:auto;vertical-align:middle" title=":x:" alt="❌" />x:x ho fatto numerosi tentavi ma senza risultato.</p>
<p dir="auto">Poi vorrei che cliccando sul tasto il tutto fosse inviato a questa pagina  <a href="http://www.designgrouparchitetti.it/contattami2.php" rel="nofollow ugc">http://www.designgrouparchitetti.it/contattami2.php</a><br />
????????? vi chiedo un aiutino per finire queste due pagine.</p>
<p dir="auto">Vi mando anche il link ai due esempi che ho scaricato, magari ho saltato qualcosa per questo non funzionano:</p>
<p dir="auto"><a href="http://www.designgrouparchitetti.it/form.php" rel="nofollow ugc">http://www.designgrouparchitetti.it/form.php</a><br />
<a href="http://www.designgrouparchitetti.it/create_gif.php" rel="nofollow ugc">http://www.designgrouparchitetti.it/create_gif.php</a></p>
<p dir="auto">Grazie a tutti<br />
Sabri</p>
]]></description><link>https://dev.connect.gt/topic/47314/script-per-generazioni-immagini-probblemi-di-funzionamento</link><generator>RSS for Node</generator><lastBuildDate>Sat, 05 Dec 2026 07:27:00 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/47314.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 18 Sep 2007 16:03:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to script per generazioni immagini probblemi di funzionamento on Wed, 19 Sep 2007 10:19:37 GMT]]></title><description><![CDATA[<p dir="auto">Allora ho modificato qualcosina.....<br />
l'immagine si vede, viene generata corretamente.</p>
<p dir="auto">adesso però non capisco una cosa.<br />
Quando clicco sopra l'immagine corretta non succede niente..........</p>
<p dir="auto">e poi non rieco a far si che tutti i dati del form una volta confermata l'immagine corretta, vengano inviati ad un'altra pagina.</p>
]]></description><link>https://dev.connect.gt/post/603197</link><guid isPermaLink="true">https://dev.connect.gt/post/603197</guid><dc:creator><![CDATA[sabrinef]]></dc:creator><pubDate>Wed, 19 Sep 2007 10:19:37 GMT</pubDate></item></channel></rss>