Форум dkLab и Denwer
Здесь общаются Web-разработчики.
Генеральный спонсор:
Хостинг «Джино»

Не выводит таблицы с рачётами (Dia28)
Author Message
Dia28
Заглянувший



Joined: 20 Oct 2012
Posts: 4
Карма: -1
   поощрить/наказать


PostPosted: Thu Oct 25, 2012 9:34 pm (написано за 48 секунд)
   Post subject: Не выводит таблицы с рачётами
Reply with quote

Здравствуйте помогите пожалуйста, не пойму почему не происходят расчёты между страницами
первая страница p1.html переходит на a1.pl, a2.pl, a3.pl по ссылке и p2.pl по кнопке когда вводишь координаты, (страницы а1.pl a2.pl a3.pl p2.pl идентичны ), должна выводить таблица с расчётами, но заместо них пустота( архив с приложениями прилагается

p1.html
Code (html): скопировать код в буфер обмена
<html> (december.com/html/4/element/html.html)

<head> (december.com/html/4/element/head.html)
<title> (december.com/html/4/element/title.html)</title>
</head>

<body> (december.com/html/4/element/body.html)

<p (december.com/html/4/element/p.html) align="center"> (december.com/html/4/element/.html)<B> (december.com/html/4/element/b.html)</B> </p><br> (december.com/html/4/element/br.html)
<p (december.com/html/4/element/p.html) align="center"> (december.com/html/4/element/.html)<img (december.com/html/4/element/img.html) src="myris.jpg"> (december.com/html/4/element/.html)</p>
<form (december.com/html/4/element/form.html) action="http://myperl1.ru/cgi-bin/p2.pl" method="POST"> (december.com/html/4/element/.html)
<p (december.com/html/4/element/p.html) align="center"> (december.com/html/4/element/.html)<a (december.com/html/4/element/a.html) href="http://myperl1.ru/cgi-bin/a1.pl"> (december.com/html/4/element/.html)</a></p>
<p (december.com/html/4/element/p.html) align="center"> (december.com/html/4/element/.html)<a (december.com/html/4/element/a.html) href="http://myperl1.ru/cgi-bin/a2.pl"> (december.com/html/4/element/.html)</a></p>
<p (december.com/html/4/element/p.html) align="center"> (december.com/html/4/element/.html)<a (december.com/html/4/element/a.html) href="http://myperl1.ru/cgi-bin/a3.pl"> (december.com/html/4/element/.html)</a></p>

<h3 (december.com/html/4/element/h3.html) align="center"> (december.com/html/4/element/.html)</h3>

<table (december.com/html/4/element/table.html) align="center"> (december.com/html/4/element/.html)
<tr> (december.com/html/4/element/tr.html)<td> (december.com/html/4/element/td.html)x = </td><td> (december.com/html/4/element/td.html)<input (december.com/html/4/element/input.html) type="text" name="ax" size="10"> (december.com/html/4/element/.html)</td>
<td> (december.com/html/4/element/td.html)y = </td><td> (december.com/html/4/element/td.html)<input (december.com/html/4/element/input.html) type="text" name="ay" size="10"> (december.com/html/4/element/.html)</td></tr>
</table>

<h3 (december.com/html/4/element/h3.html) align="center"> (december.com/html/4/element/.html)</h3>

<table (december.com/html/4/element/table.html) align="center"> (december.com/html/4/element/.html)
<tr> (december.com/html/4/element/tr.html)<td> (december.com/html/4/element/td.html)x = </td><td> (december.com/html/4/element/td.html)<input (december.com/html/4/element/input.html) type="text" name="bx" size="10"> (december.com/html/4/element/.html)</td>
<td> (december.com/html/4/element/td.html)y = </td><td> (december.com/html/4/element/td.html)<input (december.com/html/4/element/input.html) type="text" name="by" size="10"> (december.com/html/4/element/.html)</td></tr>
</table>

<h3 (december.com/html/4/element/h3.html) align="center"> (december.com/html/4/element/.html)</h3>

<table (december.com/html/4/element/table.html) align="center"> (december.com/html/4/element/.html)
<tr> (december.com/html/4/element/tr.html)<td> (december.com/html/4/element/td.html)x = </td><td> (december.com/html/4/element/td.html)<input (december.com/html/4/element/input.html) type="text" name="cx" size="10"> (december.com/html/4/element/.html)</td>
<td> (december.com/html/4/element/td.html)y = </td><td> (december.com/html/4/element/td.html)<input (december.com/html/4/element/input.html) type="text" name="cy"  size="10"> (december.com/html/4/element/.html)</td></tr>
</table align="center"> (december.com/html/4/element/.html)

<h3 (december.com/html/4/element/h3.html) align="center"> (december.com/html/4/element/.html)</h3>

<table (december.com/html/4/element/table.html) align="center"> (december.com/html/4/element/.html)
<tr> (december.com/html/4/element/tr.html)<td> (december.com/html/4/element/td.html)x = </td><td> (december.com/html/4/element/td.html)<input (december.com/html/4/element/input.html) type="text" name="ex" size="10"> (december.com/html/4/element/.html)</td>
<td> (december.com/html/4/element/td.html)y = </td><td> (december.com/html/4/element/td.html)<input (december.com/html/4/element/input.html) type="text" name="ey" size="10"> (december.com/html/4/element/.html)</td></tr>
</table>
<br> (december.com/html/4/element/br.html)
<table (december.com/html/4/element/table.html) align="center"> (december.com/html/4/element/.html)
<tr> (december.com/html/4/element/tr.html)<td> (december.com/html/4/element/td.html)<input (december.com/html/4/element/input.html) type="submit" name="go" value=" " > (december.com/html/4/element/.html)</td>
<td> (december.com/html/4/element/td.html)<input (december.com/html/4/element/input.html) type="reset" name="r" value="  " > (december.com/html/4/element/.html)</td>
</table>

</form>
</body>

</html>
Code (perl): скопировать код в буфер обмена
a1.pl
#!/usr/bin/perl -w

use CGI::Carp qw (www.perldoc.com/perl5.6/pod/func/qw.html)(fatalsToBrowser);
use CGI qw (www.perldoc.com/perl5.6/pod/func/qw.html)( :standard);
use Time::HiRes qw (www.perldoc.com/perl5.6/pod/func/qw.html)(gettimeofday tv_interval);

print (www.perldoc.com/perl5.6/pod/func/print.html) "Content-type: text/html\n\n";

$ax = 10;
$ay = 0;
$bx = 30;
$by = 100;
$cx = 100;
$cy = 100;
$dx = 70;
$dy = 0;

print (www.perldoc.com/perl5.6/pod/func/print.html) "<html>";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<head>";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<title>  1</title>";
print (www.perldoc.com/perl5.6/pod/func/print.html) "</head><body>\n";


if($by != $cy || $ay != $ey)
{
print (www.perldoc.com/perl5.6/pod/func/print.html) "   ";
}
else
        {
                if((e.x > b.x)&&(e.x < c.x))

                {

                       
                        $k1 = ($by - $ay)/($bx - $ax);
                        $b1 = $by - $k1*$bx;


                        $k2 = ($cy - $ey)/($cx - $ex);
                        $b2 = $ey - $k2*$ex;

                       

                       

       
print (www.perldoc.com/perl5.6/pod/func/print.html) "<table border=\"1\">";
                       
print (www.perldoc.com/perl5.6/pod/func/print.html) "<tr><td width=\"10\"> </td><td> </td><td>  </td><td></td><td>(%)</td><td>()</td></tr>";
                        for($N = 1000; $N <= 10000000; $N *=10)
                        {


$t0 = [gettimeofday];
                                $count1 = 0;

                        for($i = 1; $i <= $N; $i++)
                        {
                               
                                $xyx = int (www.perldoc.com/perl5.6/pod/func/int.html)(rand (www.perldoc.com/perl5.6/pod/func/rand.html)($cx - $ax) )+ $ax;
                                $xyx = rand (www.perldoc.com/perl5.6/pod/func/rand.html)($by);
                $bx=$xyy-$k1*$xyx;
                            $bxx=$xyy-$k2*$xyx;
                       
                                if(($bx<=$b1) && ($bxx>=$b2))
                                {$count1++;}
                        }

                $sguare=($cx-$ax)*($by-$ay);
                $sguare2=$sguare*($count1/$n);
                $sguare3=0.5*($by-$ay)*(($cx-$bx)+($ex-$ax));
                $pogr=(($sguare3-$sguare2)/$sguare3) *100 ;

$t1[gettimeofday];
$t0_t1 = tv_interval($t0, $t1) * 1000;

                       
                       

print (www.perldoc.com/perl5.6/pod/func/print.html) "<tr>";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<td width=\"10\" align=\"center\">$N</td>";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<td width=\"10\" align=\"center\">$count1</td>";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<td width=\"10\" align=\"center\">";
printf (www.perldoc.com/perl5.6/pod/func/printf.html) "%.2f", $sguare2;
print (www.perldoc.com/perl5.6/pod/func/print.html) "</td>";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<td width=\"10\" align=\"center\">";
printf (www.perldoc.com/perl5.6/pod/func/printf.html) "%.2f", $sguare3;
print (www.perldoc.com/perl5.6/pod/func/print.html) "</td>";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<td width=\"10\" align=\"center\">";
printf (www.perldoc.com/perl5.6/pod/func/printf.html) "%.2f", $Pogr;
print (www.perldoc.com/perl5.6/pod/func/print.html) "</td>";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<td width=\"10\" align=\"center\">";
printf (www.perldoc.com/perl5.6/pod/func/printf.html) "%.2f", $t0_t1;
print (www.perldoc.com/perl5.6/pod/func/print.html) "</td></tr>";

                       
                        }  print (www.perldoc.com/perl5.6/pod/func/print.html) "</table>";
                }
               
if($ex > $cx)
                {
                        
                        $k1 = ($by - $ay)/($bx - $ax);
                        $b1 = $by - $k1*$bx;
                        $k2 = ($cy - $ey)/($cx - $ex);
                        $b2 = $ey - $k2*$ex;

print (www.perldoc.com/perl5.6/pod/func/print.html) "<br>";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<table width=\"10\" border=\"1\">";
                       
print (www.perldoc.com/perl5.6/pod/func/print.html) "<tr><td width=\"10\"> </td><td> </td><td>  </td><td></td><td>,%</td><td>, </td></tr>";
                        for($N = 1000; $N <= 10000000; $N *=10)
                        {


$t0 = [gettimeofday];
                                $count1 = 0;

                        for($i = 1; $i <= $N; $i++)
                        {
                               
                                $xyx = int (www.perldoc.com/perl5.6/pod/func/int.html)(rand (www.perldoc.com/perl5.6/pod/func/rand.html)($cx - $ax) )+ $ax;
                                $xyx = rand (www.perldoc.com/perl5.6/pod/func/rand.html)($by);
                $bx=$xyy-$k1*$xyx;
                            $bxx=$xyy-$k2*$xyx;
                       
                                if(($bx<=$b1) && ($bxx<=$b2))
                                {$count1++;}
                        }

                $sguare=($ex-$ax)*($by-$ay);
                $sguare2=$sguare*($count1/$n);
                $sguare3=0.5*($by-$ay)*(($cx-$bx)+($ex-$ax));
                $pogr=(($sguare3-$sguare2)/$sguare3) *100 ;

$t1[gettimeofday];
$t0_t1 = tv_interval($t0, $t1) * 1000;

                       
                       

print (www.perldoc.com/perl5.6/pod/func/print.html) "<tr>";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<td width=\"10\" align=\"center\">$N</td>";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<td width=\"10\" align=\"center\">$count1</td>";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<td width=\"10\" align=\"center\">";
printf (www.perldoc.com/perl5.6/pod/func/printf.html) "%.2f", $sguare2;
print (www.perldoc.com/perl5.6/pod/func/print.html) "</td>";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<td width=\"10\" align=\"center\">";
printf (www.perldoc.com/perl5.6/pod/func/printf.html) "%.2f", $sguare3;
print (www.perldoc.com/perl5.6/pod/func/print.html) "</td>";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<td width=\"10\" align=\"center\">";
printf (www.perldoc.com/perl5.6/pod/func/printf.html) "%.2f", $Pogr;
print (www.perldoc.com/perl5.6/pod/func/print.html) "</td>";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<td width=\"10\" align=\"center\">";
printf (www.perldoc.com/perl5.6/pod/func/printf.html) "%.2f", $t0_t1;
print (www.perldoc.com/perl5.6/pod/func/print.html) "</td></tr>";
                       
                        }print (www.perldoc.com/perl5.6/pod/func/print.html) "</table>";
                }
                               
                if($ex == $cx)
                {
                        $k1 = ($by - $ay)/($bx - $ax);
                        $b1 = $by - $k1*$bx;

                        $k2 = 0;
                        $b2 = $ey - $k2*$ex;

print (www.perldoc.com/perl5.6/pod/func/print.html) "<table width=\"10\" border=\"1\">";
                       
print (www.perldoc.com/perl5.6/pod/func/print.html) "<tr><td width=\"10\"> </td><td> </td><td>  </td><td></td><td>(%)</td><td>()</td></tr>";
                for($N = 1000; $N <= 10000000; $N *=10)
                {
$t0 = [gettimeofday];
                        
                        $count1 = 0;

                        for($i = 1; $i <= $N; $i++)
                        {
                               
                                $xyx = int (www.perldoc.com/perl5.6/pod/func/int.html)(rand (www.perldoc.com/perl5.6/pod/func/rand.html)($cx - $ax) )+ $ax;
                                $xyx = rand (www.perldoc.com/perl5.6/pod/func/rand.html)($by);
                                $bx=$xyy-$k1*$xyx;
                                $bxx=$xyy-$k2*$xyx;
                       
                                if($bx<=$b1)
                                {$count1++;}
                        }

                $sguare=($cx-$ax)*($by-$ay);
                $sguare2=$sguare*($count1/$n);
                $sguare3=0.5*($by-$ay)*(($cx-$bx)+($ex-$ax));
                $pogr=(($sguare3-$sguare2)/$sguare3) *100 ;


               
$t1[gettimeofday];
$t0_t1 = tv_interval($t0, $t1) * 1000;

                       
                       

print (www.perldoc.com/perl5.6/pod/func/print.html) "<tr>";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<td width=\"10\" align=\"center\">$N</td>";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<td width=\"10\" align=\"center\">$count1</td>";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<td width=\"10\" align=\"center\">";
printf (www.perldoc.com/perl5.6/pod/func/printf.html) "%.2f", $sguare2;
print (www.perldoc.com/perl5.6/pod/func/print.html) "</td>";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<td width=\"10\" align=\"center\">";
printf (www.perldoc.com/perl5.6/pod/func/printf.html) "%.2f", $sguare3;
print (www.perldoc.com/perl5.6/pod/func/print.html) "</td>";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<td width=\"10\" align=\"center\">";
printf (www.perldoc.com/perl5.6/pod/func/printf.html) "%.2f", $Pogr;
print (www.perldoc.com/perl5.6/pod/func/print.html) "</td>";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<td width=\"10\" align=\"center\">";
printf (www.perldoc.com/perl5.6/pod/func/printf.html) "%.2f", $t0_t1;
print (www.perldoc.com/perl5.6/pod/func/print.html) "</td></tr>";

                }print (www.perldoc.com/perl5.6/pod/func/print.html) "</table>";
        }
       
               
}

print (www.perldoc.com/perl5.6/pod/func/print.html) "<form action=\"http://myperl1.ru/p1.html\" method=\"post\">";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<br>";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<input type=\"submit\" value=\"\">";
print (www.perldoc.com/perl5.6/pod/func/print.html) "</form>";

print (www.perldoc.com/perl5.6/pod/func/print.html) "<form action=\"p2.pl\" method=\"post\">";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<br>";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<input type=\"hidden\" value=\"$ax\" name=\"x1\">";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<input type=\"hidden\" value=\"$ay\" name=\"y1\">";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<input type=\"hidden\" value=\"$bx\" name=\"x2\">";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<input type=\"hidden\" value=\"$by\" name=\"y2\">";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<input type=\"hidden\" value=\"$cx\" name=\"x3\">";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<input type=\"hidden\" value=\"$cy\" name=\"y3\">";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<input type=\"hidden\" value=\"$dx\" name=\"x4\">";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<input type=\"hidden\" value=\"$dy\" name=\"y4\">";
print (www.perldoc.com/perl5.6/pod/func/print.html) "<input type=\"submit\" value=\"\">";
print (www.perldoc.com/perl5.6/pod/func/print.html) "</form>";


print (www.perldoc.com/perl5.6/pod/func/print.html) "</body></html>\n";
Back to top
View user's profile Send private message
Dia28
Заглянувший



Joined: 20 Oct 2012
Posts: 4
Карма: -1
   поощрить/наказать


PostPosted: Sat Oct 27, 2012 11:28 am (спустя 1 день 13 часов 54 минуты; написано за 2 секунды)
   Post subject:
Reply with quote

как только не кручу таблицу не видит html страница и не понимаю почему, или не считываются параметры (но это тоже загадка(
Back to top
View user's profile Send private message
Ant
Сотрудник «Лаборатории»



Joined: 17 Jun 2003
Posts: 6837
Карма: 131
   поощрить/наказать


PostPosted: Tue Oct 30, 2012 2:47 pm (спустя 3 дня 3 часа 18 минут; написано за 1 минуту 52 секунды)
   Post subject:
Reply with quote

Слишком много ненужного кода для отладки. Оставьте только самое необходимое (минимум кода, который не работает), и выкладывайте два (!) файла, а не несколько одинаковых. Отлаживать вам программу целиком тут никто не будет. Если по коду есть где-то ошибки - смотрите логи Apache.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic All times are GMT + 3 Hours
Page 1 of 1    Email to a Friend.
You cannot post new topics in this forum. You cannot reply to topics in this forum. You cannot edit your posts in this forum. You cannot delete your posts in this forum. You cannot vote in polls in this forum. You cannot attach files in this forum. You cannot download files in this forum.
XML