1
I use this code that is to return data related to each searched name, but the query only works if I type a name identica, I wanted to type "Smartphone" and it returns me all the searches that have this flood in the title. Can you help me?
<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>" >
Nome <input type="text" name="nome" value="" />
<input type="submit" name="submit" />
</form>
<?php
if (isset($_POST['submit'])) {
$xml = simplexml_load_file('https://actionpay.net/br-pt/couponFeed/xmlFilter/id:6607');
$erro = 0;
foreach ($xml->promotion AS $val) {
if ($val->title == $_POST['nome']) {
echo "<div class='single-product'>
<div class='product-f-image'>
<div class='product-hover'>
<a href='$val->offer_link' class='add-to-cart-link' target='_blank'><img src='$val->logo' alt=''>$val->title</a>
</div>
</div>
<div class='product-carousel-price'>
<del></del>
</div>
</div>";
$erro++;
}
}
if ($erro == 0) {
echo "nenhum valor encontrado";
}
}
?>
Perfect, thank you very much brother.
– Nogueira
@Walnut if it worked marks the answer as right to help anyone with the same doubt. Vlw
– ThiagoYou