I need some help!
Why does the following code:
function buildDeleteForm($deleteUrl,$searchArray) {
print ("<form target=\"_self\" method=\"post\">
");
print ("<input type=\"hidden\" name=\"delUrl\" value=\"" . $deleteUrl . "\" />
");
print ("<input type=\"hidden\" name=\"url\" value=\"" . $searchArray . "\" />
");
print ("<input type=\"submit\" name=\"delete\" value=\"delete\" />
</form>
");
}
foreach ($urls as $url) {
$url = preg_replace('/\s+/', '', $url);
print("<tr><td>" . $url . "</td>");
$response = sendRestRequest($url,$type);
$status = $response['http_code'];
if ($status == 200) {
// build the form
print("<td class=\"result\"><img src=\"200.png\"></td><td class=\"right\">" . buildDeleteForm($url,$urllist) . "</td></tr>");
} elseif ($status == 404) {
print("<td class=\"result\"><img src=\"404.png\"></td><td class=\"right\"> </td></tr>");
} else {
print("<td class=\"result\"><img src=\"error.png\"></td><td class=\"right\">" . $status . "</td></tr>");
}
}
Produce this crazy HTML:
<tr>
<td>
http://someserver4017.site.com/resources/datacaches/xi50cache/xi50cache_RetailItemCommunication_se.LUT/sv_art_40101790
</td>
<form target="_self" method="post">
<input type="hidden" name="delUrl" value="http://someserver4017.site.com/resources/datacaches/xi50cache/xi50cache_RetailItemCommunication_se.LUT/sv_art_40101790" />
<input type="hidden" name="url" value="http://someserver4017.site.com/resources/datacaches/xi50cache/xi50cache_RetailItemCommunication_se.LUT/sv_art_40101790,http://someserver4018.site.com/resources/datacaches/xi50cache/xi50cache_RetailItemCommunication_se.LUT/sv_art_40101790,http://someserver4020.site.com/resources/datacaches/xi50cache/xi50cache_RetailItemCommunication_se.LUT/sv_art_40101790" />
<input type="submit" name="delete" value="delete" />
</form>
<td class="result">
<img src="200.png">
</td>
<td class="right">
</td>
</tr>
It's taken the form completely out of the table cell ... I could understand if it was just a css thing, but this is the actual generated source code being completely wierd. I know it's something simple that I just can't see and will look stupid - but hey I just want the thing to work :)