Edited 2001-04-05 by tilly to break the display on SoPW.#!/usr/bin/perl -w print "Content-type: text/html\n\n"; read(STDIN,$form, $ENV{'CONTENT_LENGTH'}); foreach $pair (split('&', $form)) { if ($pair =~ /(.*)=(.*)/) { # found key=value; ($key,$value) = ($1,$2); # get key, value. $value =~ s/\+/ /g; # substitute spaces for + signs. $value =~ s/%(..)/pack('c',hex($1))/eg; $inputs{$key} = $value; # Create Associative Array. } } $encabezado = $inputs{'encabezado'}; $texto = $inputs{'texto'}; $archivo = $inputs{'archivo'}; $foto = $inputs{'foto'}; $cat = $inputs{'cat'}; if($ndcat == 1) { $t4enc = "$t3enc"; $t3enc = "$t2enc"; $t2enc = "$t1enc"; $t1enc = "$ndenc"; $t4text = "$t3text"; $t3text = "$t2text"; $t2text = "$t1text"; $t1text = "$ndtext"; $t4arch = "$t3arch"; $t3arch = "$t2arch"; $t2arch = "$t1arch"; $t1arch = "$ndarch"; $t4foto = "$t3foto"; $t3foto = "$t2foto"; $t2foto = "$t1foto"; $t1foto = "$ndfoto"; } if($ndcat == 2) { $a4enc = "$a3enc"; $a3enc = "$a2enc"; $a2enc = "$a1enc"; $a1enc = "$ndenc"; $a4text = "$a3text"; $a3text = "$a2text"; $a2text = "$a1text"; $a1text = "$ndtext"; $a4arch = "$a3arch"; $a3arch = "$a2arch"; $a2arch = "$a1arch"; $a1arch = "$ndarch"; $a4foto = "$a3foto"; $a3foto = "$a2foto"; $a2foto = "$a1foto"; $a1foto = "$ndfoto"; } if($ndcat == 3) { $d4enc = "$d3enc"; $d3enc = "$d2enc"; $d2enc = "$d1enc"; $d1enc = "$ndenc"; $d4text = "$d3text"; $d3text = "$d2text"; $d2text = "$d1text"; $d1text = "$ndtext"; $d4arch = "$d3arch"; $d3arch = "$d2arch"; $d2arch = "$d1arch"; $d1arch = "$ndarch"; $d4foto = "$d3foto"; $d3foto = "$d2foto"; $d2foto = "$d1foto"; $d1foto = "$ndfoto"; } if($ndcat == 4) { $h4enc = "$h3enc"; $h3enc = "$h2enc"; $h2enc = "$h1enc"; $h1enc = "$ndenc"; $h4text = "$h3text"; $h3text = "$h2text"; $h2text = "$h1text"; $h1text = "$ndtext"; $h4arch = "$h3arch"; $h3arch = "$h2arch"; $h2arch = "$h1arch"; $h1arch = "$ndarch"; $h4foto = "$h3foto"; $h3foto = "$h2foto"; $h2foto = "$h1foto"; $h1foto = "$ndfoto"; } if($ndcat == 5) { $s4enc = "$s3enc"; $s3enc = "$s2enc"; $s2enc = "$s1enc"; $s1enc = "$ndenc"; $s4text = "$s3text"; $s3text = "$s2text"; $s2text = "$s1text"; $s1text = "$ndtext"; $s4arch = "$s3arch"; $s3arch = "$s2arch"; $s2arch = "$s1arch"; $s1arch = "$ndarch"; $s4foto = "$s3foto"; $s3foto = "$s2foto"; $s2foto = "$s1foto"; $s1foto = "$ndfoto"; } if($ndcat == 5) { $r4enc = "$r3enc"; $r3enc = "$r2enc"; $r2enc = "$r1enc"; $r1enc = "$ndenc"; $r4text = "$r3text"; $r3text = "$r2text"; $r2text = "$r1text"; $r1text = "$ndtext"; $r4arch = "$r3arch"; $r3arch = "$rs2arch"; $r2arch = "$r1arch"; $r1arch = "$ndarch"; $r4foto = "$r3foto"; $r3foto = "$r2foto"; $r2foto = "$r1foto"; $r1foto = "$ndfoto"; } $ndenc = "$encabezado"; $ndtext = "$texto"; $ndarch = "$archivo"; $ndfoto = "$foto"; $ndcat = "$cat"; $noticias = "/var/www/html/noticias.html"; open(NOT, "> $noticias") or die("Couldn't open $noticias\n"); print NOT <<"FIN"; <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1 +"> </head> <body bgcolor="#FFFFFF" text="#000000"> <table width="77%" border="0"> <tr> <td bgcolor="#FFCC33" width="45%"><b><font size="3">Noticia del Di +a</font></b></td> <td bgcolor="#FFCC33" width="5%"> </td> <td bgcolor="#FFCC33" width="50%"> </td> </tr> <tr> <td height="33" width="45%"><font size="2"><b><a href="http://www. +dosvalles.com.mx/noticias/$ndarch">$ndenc</a></b></font></td> <td height="33" width="5%"> </td> <td height="33" width="50%"> </td> </tr> <tr> <td width="45%"><font size="2">$ndtext</font></td> <td width="5%"> </td> <td width="50%"> <div align="center"><img src="/noticias/images/$ndfoto" width="2 +11" height="52"></div> </td> </tr> <tr> <td width="45%"> </td> <td width="5%"> </td> <td width="50%"> </td> </tr> <tr> <td width="45%"> </td> <td width="5%"> </td> <td width="50%"> </td> </tr> <tr> <td bgcolor="#669966" width="45%"><b><font size="3">Tecnologia</fo +nt></b></td> <td bgcolor="#FFFFFF" width="5%"> </td> <td bgcolor="#00CCFF" width="50%"><b>Hogar y Familia</b></td> </tr> <tr> <td height="22" width="45%"><font size="2"><a href="http://www.dos +valles.com.mx/noticias/$t1arch">$t1enc</a></font></td> <td height="22" width="5%"> </td> <td height="22" width="50%"><font size="2"><a href="http://www.dos +valles.com.mx/noticias/$h1arch">$h1enc</a></font></td> </tr> <tr> <td height="22" width="45%"><font size="2"><a href="http://www.dos +valles.com.mx/noticias/$t2arch">$t2enc</a></font></td> <td height="22" width="5%"> </td> <td height="22" width="50%"><a href="http://www.dosvalles.com.mx/n +oticias/$h2arch"><font size="2">$h2enc</font></a></td> </tr> <tr> <td width="45%"><font size="2"><a href="http://www.dosvalles.com.m +x/noticias/$t3arch">$t3enc</a></font></td> <td width="5%"> </td> <td width="50%"><a href="http://www.dosvalles.com.mx/noticias/$h3a +rch"><font size="2">$h3enc</font></a></td> </tr> <tr> <td width="45%"><font size="2"><a href="http://www.dosvalles.com.m +x/noticias/$t4arch">$t4enc</a></font></td> <td width="5%"> </td> <td width="50%"><a href="http://www.dosvalles.com.mx/noticias/$h4a +rch"><font size="2">$h4enc</font></a></td> </tr> <tr> <td bgcolor="#FF0000" width="45%"><b>Agronegocios</b></td> <td width="5%"> </td> <td width="50%" bgcolor="#66CC66"><b>Sociales</b></td> </tr> <tr> <td width="45%"><font size="2"><a href="http://www.dosvalles.com.m +x/noticias/$a1arch">$a1enc</a></font></td> <td width="5%"> </td> <td width="50%"><font size="2"><a href="http://www.dosvalles.com.m +x/noticias/$s1arch">$s1enc</a></font></td> </tr> <tr> <td width="45%"><font size="2"><a href="http://www.dosvalles.com.m +x/noticias/$a2arch">$a2enc</a></font></td> <td width="5%"> </td> <td width="50%"><font size="2"><a href="http://www.dosvalles.com.m +x/noticias/$s2arch">$s2enc</a></font></td> </tr> <tr> <td width="45%"><font size="2"><a href="http://www.dosvalles.com.m +x/noticias/$a3arch">$a3enc</a></font></td> <td width="5%"> </td> <td width="50%"><font size="2"><a href="http://www.dosvalles.com.m +x/noticias/$s3arch">$s3enc</a></font></td> </tr> <tr> <td width="45%"><font size="2"><a href="http://www.dosvalles.com.m +x/noticias/$a4arch">$a4enc</a></font></td> <td width="5%"> </td> <td width="50%"><font size="2"><a href="http://www.dosvalles.com.m +x/noticias/$s4arch">$s4enc</a></font></td> </tr> <tr> <td bgcolor="#0066CC" width="45%"><b>Deportes</b></td> <td width="5%"> </td> <td bgcolor="#CC33CC" width="50%"><b>Recreación</b></td> </tr> <tr> <td width="45%"><font size="2"><a href="http://www.dosvalles.com.m +x/noticias/$d1arch">$d1enc</a></font></td> <td width="5%"> </td> <td width="50%"><font size="2"><a href="http://www.dosvalles.com.m +x/noticias/$r1arch">$r1enc</a></font></td> </tr> <tr> <td width="45%"><font size="2"><a href="http://www.dosvalles.com.m +x/noticias/$d2arch">$d2enc</a></font></td> <td width="5%"> </td> <td width="50%"><font size="2"><a href="http://www.dosvalles.com.m +x/noticias/$r2arch">$r2enc</a></font></td> </tr> <tr> <td width="45%"><font size="2"><a href="http://www.dosvalles.com.m +x/noticias/$d3arch">$d3enc</a></font></td> <td width="5%"> </td> <td width="50%"><font size="2"><a href="http://www.dosvalles.com.m +x/noticias/$r3arch">$r3enc</a></font></td> </tr> <tr> <td width="45%"><font size="2"><a href="http://www.dosvalles.com.m +x/noticias/$d4arch">$d4enc</a></font></td> <td width="5%"> </td> <td width="50%"><font size="2"><a href="http://www.dosvalles.com.m +x/noticias/$r4arch">$r4enc</a></font></td> </tr> <tr> <td width="45%"> </td> <td width="5%"> </td> <td width="50%"> </td> </tr> <tr> <td width="45%"> </td> <td width="5%"> </td> <td width="50%"> </td> </tr> <tr> <td width="45%"> </td> <td width="5%"> </td> <td width="50%"> </td> </tr> <tr> <td width="45%"> </td> <td width="5%"> </td> <td width="50%"> </td> </tr> <tr> <td width="45%"> </td> <td width="5%"> </td> <td width="50%"> </td> </tr> <tr> <td width="45%"> </td> <td width="5%"> </td> <td width="50%"> </td> </tr> <tr> <td width="45%"> </td> <td width="5%"> </td> <td width="50%"> </td> </tr> <tr> <td width="45%"> </td> <td width="5%"> </td> <td width="50%"> </td> </tr> </table> </body> </html> FIN close NOT;
In reply to How can I remember vars values by aletz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |