这是我的代码:
输入
<div class ="box">
<div class="textbox">
<label>Job Name</label>
<input type ="text" class="text" name ="jobname" class="sup">
<br><label>Time</label>
<input type ="text" class="text" name ="jobtime">
<br><label>Day</label>
<input type ="date" class="text" name ="jobday">
<br><label>Venue</label>
<input type ="text" class="text" name ="venue">
<br><label>No. Of Worker</label>
<select id="worker" name="worker">
<option value="">Select</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
<br><label>Phone Number</label>
<label>+601</label> <input type ="text" class="phone" name ="phonenum">
<br><label>Job Scope</label>
<textarea id="inform" rows="2" cols="19" name ="inform"></textarea>
</div>
输出
<?php
include("DB.php");
$query = "SELECT * FROM createjob";
$result = mysqli_query($link,$query);
if (mysqli_num_rows($result) > 0) {
// output data of each row
while ($row = mysqli_fetch_assoc($result)){
$id = $row["id"];
$jobname = $row["jobname"];
$jobtime = $row["jobtime"];
$jobday = $row["jobday"];
$venue = $row["venue"];
$worker = $row["worker"];
$inform = $row["inform"];
$phonenum = $row["phonenum"];
?>
根据上面的代码,我尝试将 更改<td><?php echo nl2br($inform);?></td>为链接,但失败了。所以我想做的是,无论用户在inform文本区域中插入什么,它都会将用户的输入更改为链接。
阿波罗的战车