Jump to content

Posting from <table>


derrick katungi

Recommended Posts

the code is in a form whose method = "post".

i have failed to echo $r_in. i eed help on this.

 

$lowest_time = 30 - 14;

$adder = 2*5*9;

 

echo  '<table width="526" border="0"><tr>

<td width="169">

<input type="text" name="$r_in" value="'.$lowest_time.'"  style="width:169px" readonly="readonly" class="text_non_color"/></td>

<td width="169">

<input type="text" name="$r_out" value="'.$adder.'"  style="width:169px" readonly="readonly" class="text_non_color"/></td>

</tr></table>';

Link to comment
https://forums.phpfreaks.com/topic/246452-posting-from/
Share on other sites

<!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">

<head>

<title>testing</title>

<link href="styler.css" rel="stylesheet" type="text/css" />

</head>

<body>

<?php

 

error_reporting(0);

 

 

$lowest_time = date('H:i:s',(strtotime() + (0.0000000000000000 * 86400)));

$adder = date('H:i:s',(strtotime() + (0.0000000000000000 + 0.0416666666666667) * 86400));

 

echo  '<table width="526" border="0"><tr>

<td width="169">

<input type="text" name="" value="'.$lowest_time.'"  style="width:169px" readonly="readonly" class="text_non_color"/></td>

<td width="169">

<input type="text" name="" value="'.$adder.'"  style="width:169px" readonly="readonly" class="text_non_color"/></td>

<td width="169">

<input type="text" name="" value="'.$number1.'"  style="width:169px" readonly="readonly" class="text_non_color"/></td>

</tr></table>';

 

 

 

for($i = 0; $i <= 5; $i++)

{

echo '<table width="526" border="0"><tr>

<td width="169">

<input type="text" name="" value="'.date('H:i:s',(strtotime() + (($r_inn + 0.0416666666666667) * 86400))).'"  style="width:169px" readonly="readonly" class="text_non_color"/></td>

<td width="169">

<input type="text" name="" value="'.date('H:i:s',(strtotime() + (($r_outt + 0.0416666666666667) * 86400))).'"  style="width:169px" readonly="readonly" class="text_non_color"/></td>

<td width="169">

<input type="text" name="" value="'.$number1.'"  style="width:169px" readonly="readonly" class="text_non_color"/></td>';

 

}

?>

</body>

</html>

 

i dont know what the name= ""  attribute should be.

i want the output to be something like this.

 

12:00:00 - 01:00:00

01:00:00 - 02:00:00

02:00:00 - 03:00:00

Link to comment
https://forums.phpfreaks.com/topic/246452-posting-from/#findComment-1265566
Share on other sites

what is the variable value? $r_in

  Quote

echo  '<table width="526" border="0"><tr>

      <td width="169">

      <input type="text" name="$r_in" value="'.$lowest_time.'"  style="width:169px" readonly="readonly" class="text_non_color"/></td>

      <td width="169">

      <input type="text" name="$r_out" value="'.$adder.'"  style="width:169px" readonly="readonly" class="text_non_color"/></td>

      </tr></table>';

 

Why in input tag name attribute empty?

   <input type="text" name="" value="'.$number1.'"  style="width:169px" readonly="readonly" class="text_non_color"/></td>      

 

Link to comment
https://forums.phpfreaks.com/topic/246452-posting-from/#findComment-1265627
Share on other sites

<!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">

<head>

<title>testing</title>

<link href="styler.css" rel="stylesheet" type="text/css" />

</head>

<body>

<?php

 

error_reporting(0);

 

 

$lowest_time = date('H:i:s',(strtotime() + (0.0000000000000000 * 86400)));

$adder = date('H:i:s',(strtotime() + (0.0000000000000000 + 0.0416666666666667) * 86400));

 

echo  '<table width="526" border="0"><tr>

      <td width="169">

      <input type="text" name="$r_in[]" value="'.$lowest_time.'"  style="width:169px" readonly="readonly" class="text_non_color"/></td>

      <td width="169">

      <input type="text" name="$r_out[]" value="'.$adder.'"  style="width:169px" readonly="readonly" class="text_non_color"/></td>

      </tr></table>';

 

 

 

for($i = 0; $i <= 5; $i++)

{

echo    '<table width="526" border="0"><tr>

      <td width="169">

        <input type="text" name="$r_in[]" value="'.date('H:i:s',(strtotime() + (($r_in[$i] + 0.0416666666666667) * 86400))).'"                            style="width:169px" readonly="readonly" class="text_non_color"/></td>

      <td width="169">

      <input type="text" name="$r_out[]" value="'.date('H:i:s',(strtotime() + (($r_out[$i] + 0.0416666666666667) * 86400))).'"  style="width:169px" readonly="readonly" class="text_non_color"/></td>

      </tr></table>';

 

}

?>

</body>

</html>

 

from above, it should keep on storing data into the arrays.

in the for loop, $i starts from 1 coz the index 0 is already used.

thats the idea am heading for.

Link to comment
https://forums.phpfreaks.com/topic/246452-posting-from/#findComment-1265846
Share on other sites

<!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">

<head>

<title>testing</title>

<link href="styler.css" rel="stylesheet" type="text/css" />

</head>

<body>

<?php

 

error_reporting(0);

 

 

$lowest_time = date('H:i:s',(strtotime() + (min($inn) * 86400)));

$adder = date('H:i:s',(strtotime() + ((min($inn) + 0.0416666666666667) * 86400)));

 

echo  '<form id="form1" name="form1" method="post" action="test.php">

<table width="526" border="0"><tr>

<td width="169">

<input type="text" name="$r_in[]" value="'.$lowest_time.'"  style="width:169px" readonly="readonly" class="text_non_color"/></td>

<td width="169">

<input type="text" name="$r_out[]" value="'.$adder.'"  style="width:169px" readonly="readonly" class="text_non_color"/></td>

<td width="169">

<input type="text" name="$r_num[]" value="'.$number1.'"  style="width:169px" readonly="readonly" class="text_non_color"/></td>

</tr></table>';

 

 

 

$r_time_in = min($inn);

$r_time_out = $r_time_in + 0.0416666666666667;

 

 

 

for($i = 0; $i <= 5; $i++)

{

 

$r_time_in += 0.0416666666666667;

$new_r_timer_in[$i] = $r_time_in;

$new_r_timer_out[$i] = $new_r_timer_in[$i] + 0.0416666666666667;

 

}

 

 

for($i = 0; $i <= 5; $i++)

{

 

echo '<table width="526" border="0"><tr>

<td width="169">

<input type="text" name="$r_in[]" value="'.date('H:i:s',(strtotime() + ($new_r_timer_in[$i] * 86400))).'" style="width:169px" readonly="readonly" class="text_non_color"/></td>

<td width="169">

<input type="text" name="$r_out[]" value="'.date('H:i:s',(strtotime() + ($new_r_timer_out[$i] * 86400))).'"  style="width:169px" readonly="readonly" class="text_non_color"/></td>

<td width="169">

<input type="text" name="$r_num[]" value="'.$number1.'"  style="width:169px" readonly="readonly" class="text_non_color"/></td>';

}

$html = '</table></form>';

echo $html;

 

?>

</body>

</html>

 

something like this

 

12:00:00 - 01:00:00

01:00:00 - 02:00:00

02:00:00 - 03:00:00

 

is produced fro the code above. this was what i was looking for. thanks everyone :)

Link to comment
https://forums.phpfreaks.com/topic/246452-posting-from/#findComment-1265931
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.