简体   繁体   中英

Odd paragraphs added to html after PHP POST

When i click the submit button for my search from, for each result there is a paragraph with a ">" which is put at the top of the page and I have no idea where it comes from. Here's my code (using wordpress)

[insert_php]
$db_host = "localhost";
$username = "root";
$password = "";
$dbname = "Tickets";

// Create connection
$conn = new mysqli($db_host, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
} 


if((isset($_POST['Search'])) && ($_POST['Search'] != '')){
$search = $_POST['Search'];
$sql = "SELECT * FROM `Problem_Solutions` WHERE (`Problem_Type` LIKE '%$search%') OR (`Solution_Title` LIKE '%$search%')";
$query = mysqli_query($conn, $sql);
$count = mysqli_num_rows($query);
if ($count > 0){
    echo "<table><th>Title</th><th>Solution</th><th>Count</th>";
   while ($row = mysqli_fetch_array($query)){
    echo "<tr><td>".$row['Solution_Title']."</td>";
    echo "<td>".$row['Solution']."</td>";
    echo "<td>".$row['Count']."</td>";
    echo "<<td><form name='form' method='POST'><input style='background:#6B8E23;' type='submit' name='".$row['Solution_ID']. "' value='This Solution Solved My Problem' /></form></td></tr>";
    } echo "</table>";
}else{
echo " 0 results found";
}
    }

$conn->close();

[/insert_php]

Your problem is in this line:

echo "<<td><form name='f

Delete the first <

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM