返回首页

如何使网格的大小是根据用户的输入,如果某些条件都为真,那么它的一些箱子是与colour.This的填充我的code.If是这样,我给常数值
呼应美元table_string =(4,3),它工作得很好,但如果我给它通过用户的像THI
输入值呼应table_string =表("noOfProcess,3);表不会显示

<html>

 

<head>

<title> Sheduling Algorithms </title>

</head>

 

<body>

 

<form method = "post" action = ""><br>

Number Of Processess: <input type = "text" name="noOfProcess" /><br>

<input type = "radio" name = "algo" value= "FCFS" /> FCFS <br>

<input type = "radio" name = "algo" value = "SPN" > SPN <br>

<input type = "radio" name = "algo" value = "SRT" /> SRT <br>

<input type = "radio" name = "algo" value = "RRH" /> RRH <br>

<input type= "submit">

 

</form>

 

</body>

 

</html>

 

<?php

 

function Table($rows,$columns)

{

     $table_string =

     "<table border='1' >

     <tr>

       <th> Process # </th>

       <th> Arrival Time </th>

       <th> Service Time</th>

     </tr>";

     for($j=0;$j<$columns;$j++)

     {

          $column_string.= "<td> asma </td> ";

     }

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

     {

          $table_string.= "<tr>";

          $table_string.= $column_string."</tr>";

     }

     $table_string.="</table>";

     return $table_string;

}

$noOfProcess =  $_POST["noOfProcess"];

$algo =  $_POST["algo"];

echo $table_string= Table("noOfProcess",3);

回答

评论会员:会心汗 时间:2012/02/07
只有一个错误,这是在代码的最后一行。 noOfProcess是一个变量和变量$符号应该在PHP启动。


{C}
纠正
echo $table_string= Table($noOfProcess,3);
评论会员:游客 时间:2012/02/07
使用表标签-imgsrc=http://www.orcode.com/img/ico/smiley_smile.gif]
arya1685:嗨,亲爱的,

对自己第一次尝试......
创建表标签帮助您所需的领域,并呼应从数据库中的记录,在各自的
<table><tbody><tr><td>?<?php echo "your records here";  ??></td></tr></tbody></table>
标签和颜色记录或背景如果你想记录的回声之前把您的条件
评论会员:埃斯Harlinn 时间:2012/02/07
你可能{A}感兴趣]

盒/细胞可能最终看起来相当不错的{S0的}

最好的问候
埃斯Harlinn