$aUsers[]=$row["item_name"]."<a href='cart.php'>Add to cart</a>";
dear friends it show the same code as written ....
I want show
item name and add to cart link ..plz help
$aUsers[] = $row["item_name"] . " <a href='cart.php?item_name=".urlencode($row["item_name"])."'>Add to cart</a>";
?
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
if ($len)
{
for ($i=0;$i<count($aUsers);$i++)
{
// had to use utf_decode, here
// not necessary if the results are coming from mysql
//
if (strtolower(substr(utf8_decode($aUsers[$i]),0,$len)) == $input)
$aResults[] = array( "id"=>($i+1) ,"value"=>htmlspecialchars($aUsers[$i]), "info"=>htmlspecialchars($aInfo[$i]) );
//if (stripos(utf8_decode($aUsers[$i]), $input) !== false)
// $aResults[] = array( "id"=>($i+1) ,"value"=>htmlspecialchars($aUsers[$i]), "info"=>htmlspecialchars($aInfo[$i]) );
}
}
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header ("Pragma: no-cache"); // HTTP/1.0
if (isset($_REQUEST['json']))
{
header("Content-Type: application/json");
Hope I don't sound like a stick in the mud, but next time you post code, highlight it and click the icon that looks like a piece of paper that says "PHP" on it. It's on the same line with BIU. (If you don't see it click the "Go Advanced" button.)
Look how much easier it makes code to read:
PHP Code:
<?PHP
//A script
if ($whatIam == 'A bunch of code')
{
print 'Then I probably do a bunch of stuff.';
}
?>
Thanks and happy coding
The better I get at programming, the more I appreciate arrays. Handy dandy things they are.
Bookmarks